Question: C++ Write out a void function with prototype as part of a full program called averageTemperature() that asks the user to enter integers with a
C++
Write out a void function with prototype as part of a full program called averageTemperature() that asks the user to enter integers with a sentinel value of -999 to stop entering numbers. Then average the numbers and print the average.
You will need an int accumulator for the temperatures and an int accumulator for the number of temperatures entered. Use the accumulators to calculate the average which will need to be a decimal number.
Call the function from the main() function.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
