ITEC 120 Lab Quiz 5- Friday, April 9

Lab Quiz 4 - Frank's pizza daily sales
Due at the end of lab period.
Submit your java file to a folder called RU08 in your folder on neelix.

You'll be given data which represents Frank's Pizza daily sales amount (in dollars). You'll report total sales, average daily sales, the highest daily sales, and last, the sales amount for each day.

Write a program which will:

• read in an integer which will tell you how many dollar amounts you will be given to read in
• read in that many dollar amounts, one at a time, from the keyboard.
• store the values in an array
• find the highest daily sales amount
• add up the total of all the values in the array
• output (in this order):
• total
• average daily sales
• the highest daily sales
• all of the values in the array on one line (in the same order you read them in)

Sample run:

 Program outputs: How many amounts are there? User inputs: 5 Program outputs: Enter sales for day1: User inputs: 56.76 Program outputs: Enter sales for day2: User inputs: 78.39 Program outputs: Enter sales for day3: User inputs: 105.40 Program outputs: Enter sales for day4: User inputs: 98.00 Program outputs: Enter sales for day5: User inputs: 112.50 Program outputs: Total sales was: 451.05 Average daily sales was: 90.21000000000001 The highest sale was 112.5 Daily sales: 56.76   78.39   105.4    98.0   112.5

Input for this example is here: lq4in.txt.

Extra credit possible!

• 1 point extra for formatting all numbers as dollar amounts.
• 3 points extra for sorting the daily sales numbers and outputting them again, at the end, in sorted order.

Attempt the extra credit parts only after you have completed the lab and submitted it! Then, you can work on the extra parts and submit again if you get it to work.