The purpose of this assignment is to perform Input, Process and Output. You will use the built in iostream library for input/output. Your output will use built in iomanip library for formatting. Both are described in Chapter 3.
The average bowler is a game where three players play three games each. The user will input the three scores for the three bowlers totalling nine games. Your program will calculate the average and standard deviation for the scores for each bowler. It will display the scores in a specifically aligned format shown below.
Do not use loops or arrays for your exercise. Assume the user will enter correct bowling data.
Collect the following inputs. When you enter inputs, C++ will allow you to put spaces between the numbers, so you can enter all three scores for each bolwer and press enter. See the sample bowler.exe program. You will need a variable for each game for each bowler.
Make your input prompts match the sample bowler.exe program.
Enter Player 1 game scores
98 122 165
Enter Player 2 game scores
0 0 0
Enter Player 3 game scores
27 175 265
Calculate the average and the standard deviation for the three scores for each bowler. The following web page has information for calculating standard deviation.
Web Page with Formula for Standard Deviation
Display the resulting output so that it matches the output shown by the example bowler.exe program. The header and the "Bowler 1" must show the same.
Game 1 Game 2 Game 3 Avg Std Dev
Bowler 1 98 122 165 128.33 27.72
Bowler 2 0 0 0 0.00 0.00
Bowler 3 25 175 265 155.00 98.99
Rather than manually enter inputs, you can use the input redirection operator at the command prompt. You should test boundary conditions and different values. Compare and contrast your output with the bowler.exe as reference.
c:> bowler.exe < bowlInput.txt
You may consult and discuss the exercise with classmates, but your submitted work must be your own work. I encourage students to post questions and clarifications to the "Tips and Tricks" forum.
Submit only your .cpp source code file to the dropbox for Exercise 3 in D2L. You may submit more than once, but your final submission will be the only one that is used for grading.
Name | Last modified | Size | Description | |
---|---|---|---|---|
Parent Directory | - | |||
HEADER.html | 2016-06-02 16:10 | 3.2K | ||
bowlInput.txt | 2016-05-25 16:30 | 28 | ||
bowler.exe | 2016-05-25 16:30 | 470K | ||
exercise03.md | 2016-06-02 16:10 | 2.9K | ||
exercise03.pdf | 2016-06-02 16:10 | 152K | ||