Problem

In this exercise, you create a program that calculates the average of three test scores....

In this exercise, you create a program that calculates the average of three test scores. The program should contain two value-returning functions (main and calcAverage) and two void functions (getTestScores and displayAverage). The main function should call the void getTestScores function to get three test scores. The test scores may contain a decimal place. The main function then should call the value-returning calcAverage function to calculate and return the average of the three test scores. When the calcAverage function has completed its task, the main function should call the void displayAverage function to display the average of the three test scores on the screen. Display the average with one decimal place. Use a sentinel value to end the program.

a. Create IPO charts for the problem, and then desk-check the algorithm using the following four sets of test scores, followed by your sentinel value: 56, 78, 90; 100, 85, 67; 74, 32, 98; and 25, 99, 84.

b. List the input, processing, and output items, as well as the algorithm, in a chart similar to the one shown earlier in Figure 10-39. Then, code the algorithm into a program.

c. Desk-check the program using the same data used to desk-check the algorithm.

d. If necessary, create a new project named Advanced22 Project and save it in the Cpp7\Chap10 folder. Enter your C++ instructions into a source file named Advanced22.cpp. Also enter appropriate comments and any additional instructions required by the compiler.

e. Save and then run the program. Test the program using the same data used to desk-check the program.

Figure 10-39

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search