Question: The purpose of this program is to allow a user to enter temperatures ( in Fahrenheit ) until they are finished and then display the

The purpose of this program is to allow a user to enter temperatures (in Fahrenheit) until they are finished and then display the number of days entered, an overall average temperature, and the number of days of temperatures in the three categories below. The three categories are: cool tovery cold for those days with temperatures below 50 degrees; moderate to pleasant for those days with temperatures between 50 and 75 inclusive; andwarm to scorching for those days above 75 degrees.
Use the sentinel value of 'q'-- the user should be able to enter 'q' or 'Q' to exit. For this program, do not worry about trapping for data entry errors. Also note that 0 and negative numbers are valid temperatures and should be allowed.
Be sure to follow the class Program Submission Guidelines document and to use only concepts that we've covered in class so far. Do not include user defined functions, lists, etc. or you will receive a zero for the exam.
Ex: Here is a sample of the input and output (the input below is bold for clarification only -- not to be incorporated into the program)
The input:
Enter the daily temperature or 'q' when done: 0 Enter the daily temperature or 'q' when done: 15 Enter the daily temperature or 'q' when done: 40 Enter the daily temperature or 'q' when done: 70 Enter the daily temperature or 'q' when done: 80 Enter the daily temperature or 'q' when done: 95 Enter the daily temperature or 'q' when done: 105 Enter the daily temperature or 'q' when done: q
The output:
The number of days entered: 7 The average temperature is: 57.857142857142854 The number of days in each category are: Cool to very cold (below 50 degrees): 3 Moderate to pleasant (between 50 and 75 degrees): 1 Warm to scorching (above 75): 3

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!