Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can someone help me write this code in C++? Use of while loops to: - Validate user input. - Determine the sum, count, min, highest

Can someone help me write this code in C++?

Use of while loops to: - Validate user input. - Determine the sum, count, min, highest and lowest of data values entered. Entering multiple values on one line with cout/cin.

General Description: Write a program for processing temperature readings for a period of days. The program first asks the user to enter the number of days, validating the answer between 1 and 10. It then asks the user to enter the Hi and Low Temperatures for each day. Finally, it finds and prints the highest high, lowest low, average high and average low. It should also count and print the number of days the low temperature was below freezing (less than 32 degrees). As usual, the program should pause at the end. Note: all numbers, including averages, may be integers.

Here is how should look like..

image text in transcribed

image text in transcribed

CAUsers Kevin Documents Visual Studio 20151Pr Enter number of days (1-10): 6 Enter Hi and Low for day 1 44 33 Enter Hi and Low for day 2: 55 44 Enter Hi and Low for day 3: 40 30 Enter Hi and Low for day 4 31 28 Enter Hi and Low for day 5 44 33 Enter Hi and Low for day 6 48 38 The Highs: max = 55 avg 43 The Lows: min 28 avg 34 Number of days below freezing: 2 Press any key to continue _ OW

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

=+3. Engage rather than avoid difficult topics and conversations.

Answered: 1 week ago

Question

m

Answered: 1 week ago