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
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