Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

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

Step: 3

blur-text-image

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

Oracle Database Foundations Technology Fundamentals For IT Success

Authors: Bob Bryla

1st Edition

0782143725, 9780782143720

More Books

Students also viewed these Databases questions

Question

=+ a. How does this change affect the incentives for working?

Answered: 1 week ago