Lab 16

An Above Average Summer

 

Objective:

 

Write a program that takes in temperatures for 10 days and stores it in an array.  Find the average temperature for those 10 days, and then print the number of days and the temperatures that were above average.

 

Example Dialog:

 

Welcome to the above average temperature tester program.

 

Please enter the temperature for day 1

97.0

Please enter the temperature for day 2

87.0

Please enter the temperature for day 3

85.0

Please enter the temperature for day 4

76.0

Please enter the temperature for day 5

83.0

Please enter the temperature for day 6

104.0

Please enter the temperature for day 7

78.0

Please enter the temperature for day 8

76.0

Please enter the temperature for day 9

90.0

Please enter the temperature for day 10

85.0

 

The average temperature was 86.1

The days that were above average were

Day 1 with 97

Day 2 with 87

Day 6 with 104

Day 9 with 90

 

DONE!

 

 

Lab Questions:

  1. Draw a flow chart to solve this problem in the proposed solution section.
  2. Are arrays able to change size as in grow or shrink length?
  3. What is the last valid index in an array with a given length?

Finally:

Upload the .java file to the dropbox