Description

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.

Inputs

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

Process

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

Output

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

Testing

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

Collaboration

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.

Submission

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.

Resources

Resources

[ICO]NameLast modifiedSizeDescription

[PARENTDIR]Parent Directory  -  
[TXT]HEADER.html2016-06-02 16:10 3.2K 
[TXT]bowlInput.txt2016-05-25 16:30 28  
[   ]bowler.exe2016-05-25 16:30 470K 
[TXT]exercise03.md2016-06-02 16:10 2.9K 
[   ]exercise03.pdf2016-06-02 16:10 152K 

Apache/2.4.62 (Debian) Server at brie.com Port 443