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

Ben rents a trailer to move his furniture to his new house. The basic cost is R250 per day plus a specific amount that must be entered by him per kilometre travelled. He also has to enter the distance travelled in kilometres.

If Ben travels less than 60 kilometres, an additional surcharge of 3% is payable on the amount due for distance. However, if he uses the trailer for more than 350 kilometres, he receives a discount of 9% on the amount due for distance (Pretorius & Erasmus, 2012:65).

Write a program to calculate and display the amount due.

Hint: use object oriented programming concepts to develop your program.




Ben rents a trailer to move his furniture to his new house. The basic cost is R250 per day plus a specific amount that must be entered by him per kilometre travelled. He also has to enter the distance travelled in kilometres.


If Ben travels less than 60 kilometres, an additional surcharge of 3% is payable on the amount due for distance. However, if he uses the trailer for more than 350 kilometres, he receives a discount of 9% on the amount due for distance (Pretorius & Erasmus, 2012:65).


Write a program to calculate and display the amount due.

Hint: use object oriented programming concepts to develop your program


The user must also have the ability to update specific details of the product. For example, the user must first enter the product code and then confirm whether to update the following product details:

•Update the product warranty.

•Update the product price.

•Update the product stock level


Write a program which takes as input a huge array of numbers. This array is


split into n sub-arrays and n threads apply a bubble sort on each of the n sub-

arrays. Lastly, another thread merges the n sorted sub-arrays into one with


the same size as the original array. Of course, the resulting array should be

sorted.


Define a class named Person that contains the data fields for the first name and last name. Include only a non-default constructor that that initializes the data fields and a method that displays all the information about a Person. b) Define another class named Movie that stores a title, year of production and a director information. Director should be a Person member-object (i.e. use the Person class). Include a non-default constructor and a function to display Movie information. c) Write a program that creates two Movie objects, and displays information about the Movie objects. Save the file as Cinema.jav


Use methods and a loop of your choice to develop a program that can display multiples of 10 until 150 on a single line. For example, the output should be like: 10, 20, 30, 40,…….150.



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 reads the users name and year of birth from input(keyboard), then print out
their name and age in decades(find out the meaning).
Sample run 1: Sample run 2:
Enter your name: Hausiku Enter your name: Johanna
Enter your year of birth:1999 Enter your year of birth:2005
Output: Hello Hausiku, you have lived for 2 Output: Hello Johanna, you have lived for 1
decade(s) decade(s).
Create a program that when run with two numbers as CMD arguments, it prints out the difference
and product separated by space[Hint: CMD arguments need to be converted to integers]:
Sample run 1: Sample run 2:
java lab02_task02 12 3 java lab02_task02 2 5
Output: 9 36 Output: -3 10
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
LATEST TUTORIALS
APPROVED BY CLIENTS