Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The following program prompts the user to enter the temperatures in three cities + Only one function is used to get all three values. +The
The following program prompts the user to enter the temperatures in three cities + Only one function is used to get all three values. +The average temperature of all three cities is displayed on the screen. -The following 3 fonction are called in main(): + getTemos(): The function prompts the user to enter three temperatures The numbers are read and assigned to variables. The function is a void-returning function. + calcAvg(): The function calculates the average temperature of the three cities. The value is returned to main() + displayAvg(): The function displays the information on the screen. Example OUTPUT: Enter temperatures of 3 cities. #1: 80.5 #2: 70.5 rightarrow getTemps function # 3: 60.5 The average temperature is 70.5 degrees. rightarrow displayAvg function Use the code in 1, and then make the following change Use an array to store the 3 temperatures -Pass the array to the getTemps function -After values have been stored in the array, pass the array to displayAvg()
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started