The following program prompts the user to enter the temperatures in three cities
ID: 3757270 • Letter: T
Question
The following program prompts the user to enter the temperatures in three cities (see output below). o Only one function is used to get all three values. o The average temperature of all three cities is displayed on the screen. Create a new project and name it: HW_1b Create a new file and name it: The following 3 functions are called in main0: o getTemps0 - The following 3 functions ar cat maincpp . The function prompts the user to enter three temperatures. . The numbers are read and assigned to variables. . The function is a void-returning function. o calcAvg0 . The function calculates the average temperature of the three cities. . The value is returned to main0. displayAvg() . The function displays the information on the screen. (see output) Enter temperatures of 3 cities. #1: 77.5 #2: 82.5 #3 : 71.0 getTemps function The average temperature is 77.0 degrees. displavAva functionExplanation / Answer
#include using namespace std; void getTemps(double &t1, double &t2, double &t3) { cout t3; } double calcAvg(double t1, double t2, double t3) { return (t1 + t2 + t3) / 3; } void displayAvg(double avg) { coutRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.