Computer Science 121
Assignment 7
Due: April 17, 2001

For this assignment, you are to write a program that reads in Fahrenheit temperatures from the keyboard and stores them in an array. It then should calculate the average temperature, the highest temperature and the lowest temperature. These should be displayed on the screen. Finally it should change all temperatures into Celsius and display the entire contents of the array on the screen.

Since you will not know how many temperatures will be entered, you should use a while loop to read them and keep a count of how many were read. You will need some way to indicate that all the temperatures have been read in. One way is to keep reading temperatures until a 'sentinel' temperature has been read in. Since it is possible for Fahrenheit temperatures to go below zero, zero is not a good sentinel. Choose some number that could not be a realistic temperature. You will have to indicate to the user what the 'sentinel' temperature is.

The size of an array has to be known when the program is written. You cannot change it during run-time. For this assignment, you may assume that no more than 30 temperatures will be read in. If the user tries to type in more than 30 temperatures, you should display an error message explaining that 30 is the maximum allowed.

The formula for changing Fahrenheit temperatures to Celsius is
    Celsius = 5 * (Fahrenheit - 32) / 9
You may treat all temperatures as integers. If so, the computer will use integer arithmetic rather than double. This also makes printing out the results easier.

Finally you should hand in a description of how you went about designing and writing the program. Use a word processor and write this on a separate sheet of paper.