Java | JSP | JSF Answers

Questions answered by Experts: 3 611

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search

10% discount to children who are not more than 12 years old or senior citizens who are at least 65 years old. It is further stated that ONLY those who are visiting the Park for at least the 5th time will qualify for this discount

public class KrugerNationalPark {

public static void main(String[] args){

String Age, Visit;

Age = 18;

Visit = 10;

decideDiscount(Age, Visit);

}

public static void decideDiscount(double A, char V)

{

if ((A <= 12 && >= 65) && (V >= 5));

System.out.print("You qualify for 10% discount!")

System.out.print("You deserve it!")

else

System.out.print("You do not qualify for discount")

}

}

 

the program is not executing due to at least 10 syntax errors.

1) You are required to debug the program and re-write the program without errors.

2) Re-write your program in such a way that method decideDiscount() can return a value to the calling method. The calling method will then display if a customer qualifies for a discount or not.



2. Write a java program named StampCalc.java. This program will input 3 int values from the command-line. The first will represent the number of First Class stamps requested, the second number will indicate the number of Additional Ounces needed for those first class letters, and the third number will indicate the number of International stamps requested.


The cost for First Class stamps is $.50, the cost for an Additional Ounce is $.21, and the cost for an International stamp is $1.15.


Your program will calculate the total cost for the requested number of stamps.


If the command-line values were: 5 2 6


Your output should show just one line:


The total for 5 First Class stamps, 2 additional ounces and 6 International stamps is $9.82




Special consideration needs to be made for the selection of the product category. Allow

the user to make a selection between the following categories:

• Desktop Computer.

. Laptop.

.

Tablet.

Printer.

• Gaming Console.
Q.1.2

If the user selects to capture a new product, you are required to save all the information supplied by the user into memory. To achieve this, you may use arrays or array lists.

Sample Capture Product Screenshot

CARTURE & NEW SODUCT

Inter the product code: Ass

Enter the product nass: EliteBook

Select the product category:

Laptop - 2

Caming Const

Product Category >>

Indicate the product warranty. Innar (1) for 6 months or any other tey for 2 years. 2 Enter the stock level for Elitalock 1 Enter the supplier for litellook IT 4 Africa Product details has been saved successfully!!!

Enter the price for EliteBook 15000

Intex (1) to launch masu úz any other key to exist

Create two interfaces such as MathsOperable and TrigonometricOperable which

contains the functions to perform the basic arithmetic operations (add, sub, mul, div,

mod) and trigonometric operations (sine, cosine, tan) respectively.Create an abstract class called “Calculator” with details such as no1, no2 and result. Add

necessary constructors.

Implement these interfaces and inherit the class in “Operation” class to perform the

specific operations.

Demonstrate the operations in a menu driven fashion from a Main class. Write logics in

the corresponding methods.


Design a java application that will allow a traffic department user to search for and view fines


Ever wondered how change is disbursed to customers in certain stores? In Namibia the following notes exists 200,100,50,20,10 and following coins: 5, 1, 50c, 10c, 5c. For the sake of this exercises let us only consider change below 50 see below example: Sample run 1: Enter item name: Apples Enter QTY of Apples: 2 Enter price per item N$: 3.25 Amount tendered N$: 50 Your change is: N$ 43.50 Disbursed as follows: 2 x N$20; 0 x N$10; 0 x N$5; 3 x N$1; 1 x 50c; 0 x 10c; 0 x 5c [Hint: make use of % and / operators to determine the values needed, see Pg. 113 for more info


Create a program that when given a four word sentence as CMD arguments, it prints it backwards. E.g the sentence “How are you Today”, will be printed as “Today you are How”. Sample run 1: Sample run 2: java lab02_task01 how are you today java lab02_task01 we are going home Output: today you are how Output: home going are we


create a Java Program that will display this:

You are told that the Kruger National Park is giving away a 10% discount to children who are not more than 12 years old or senior citizens who are at least 65 years old. It is further stated that ONLY those who are visiting the Park for at least the 5th time will qualify for this discount.

1) Write your program in question (I) in such a way that method decideDiscount() can return a value to the calling method. The calling method will then display if a customer qualifies for a discount or not.


Write a program that takes as input the number of visitors and for each visitor takes the amount of money they have spent in last 5 days. The program must calculate the average expenses (i.e. per day) for each visitor. The program should output the approximately amount of money each visitor will need to stay next 15 days.


LATEST TUTORIALS
APPROVED BY CLIENTS