Write a C++ program that will input temperatures for consecutive days. The program will store these values into an array and call a function that will return the average of the temperatures. It will also call a function that will return the highest temperature and a function that will return the lowest temperature. The user will input the number of temperatures to be read. There will be no more than 25 temperatures. For Full Credit You must have a comment block header at the top of your program.  See the Standards document in Course Content You must use a constant to represent the maximum number of temperature readings You must use the correct data types for your constants and variables You must use an array of the correct data type You must validate your input.   Check for number of invalid number of readings (> max, < 1, etc) and display appropriate error message. You must use one or more if/else branches for your decisions You must use a loop to read in the temperatures You must use 3 functions to calculate the average, highest and lowest temperatures Your output should be formatted correctly Temperatures should have two decimal places Sample Run #1: Please input the number of temperatures to be read: 5 Input temperature 1 68 Input temperature 2 75 Input temperature 3 36 Input temperature 4 91 Input temperature 5 84 The average temperature is 70.80 The highest temperature is 91.00 The lowest temperature is 36.00 Sample Run #2: Please input the number of temperatures to be read: 0 No temperatures entered. Sample Run #3: Please input the number of temperatures to be read: 50 Maximum number of readings is 25.

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter8: Advanced Method Concepts
Section: Chapter Questions
Problem 8RQ
icon
Related questions
Question

Write a C++ program that will input temperatures for consecutive days. The program will store these values into an array and call a function that will return the average of the temperatures. It will also call a function that will return the highest temperature and a function that will return the lowest temperature. The user will input the number of temperatures to be read. There will be no more than 25 temperatures.

For Full Credit

  • You must have a comment block header at the top of your program.  See the Standards document in Course Content
  • You must use a constant to represent the maximum number of temperature readings
  • You must use the correct data types for your constants and variables
  • You must use an array of the correct data type
  • You must validate your input.  
    • Check for number of invalid number of readings (> max, < 1, etc) and display appropriate error message.
  • You must use one or more if/else branches for your decisions
  • You must use a loop to read in the temperatures
  • You must use 3 functions to calculate the average, highest and lowest temperatures
  • Your output should be formatted correctly
    • Temperatures should have two decimal places

Sample Run #1:

Please input the number of temperatures to be read:
5
Input temperature 1
68
Input temperature 2
75
Input temperature 3
36
Input temperature 4
91
Input temperature 5
84

The average temperature is 70.80
The highest temperature is 91.00
The lowest temperature is 36.00

Sample Run #2:

Please input the number of temperatures to be read:
0
No temperatures entered.

Sample Run #3:

Please input the number of temperatures to be read:
50
Maximum number of readings is 25.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 5 images

Blurred answer
Knowledge Booster
Datatypes
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,