View Single Post
  #1 (permalink)  
Old May 30th, 2007, 02:11 AM
Lizane Lizane is offline
Authorized User
Join Date: May 2007
Location: East London, Eastern cape, South Africa.
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default Using Switch statement in XHTML

im still new at Java and im battling with the following question..
If anyone could please help me..thanx.:(

a) Write a function minimum that returns the smallest of three floating-point numbers. Use the
Math.min function to implement minimum. Incorporate the function into a script that reads
three values from the user and determines the smallest value. Display the result in the status
b) A mail-order house sells five different products whose retail prices are as follows: product 1,
R2.98; product 2, R4.50; product 3, R9.98; product 4, R4.49; and product 5, R6.87. Write a
script that reads a series of pairs of numbers as follows:
a) Product number
b) Quantity sold for one day
Your program should use a switch statement to help determine the retail price for each
product and should calculate and output XHTML that displays the total retail value of all the
products sold in a week. Use a prompt dialog to obtain all input from the user.
Use a sentinel-controlled loop to determine when the program should stop looping and
display the final results.