Question: Write a program that will prompt a user to enter three numbers of datatype double in main. The program will then call a function called

Write a program that will prompt a user to enter three numbers of datatype double in main.

The program will then call a function called calcAverage that includes all three numbers as parameters. The function will calculate the average of the three numbers and return that average(datatype double) to main.

The program will then print the average of the three numbers from main. The output should include the original numbers and the average (all formatted to two decimal places) and should look something like this:

The average of 4.25, 8.36, and 12.25 is 6.22

Test your program with these numbers:

6.85 5.24 8.64

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!