Prev Up Next
Go backward to 6.9 Floating Point Precision
Go up to 6 Labs
Go forward to 6.11 Bowling program

6.10 Bowling program

Write a program that figures out the bowling scores on a frame by frame basis. Your input data will be:
  1. Players name
  2. Number of pins knocked down with a ball.
  3. -1 For end of game (next record new players name
  4. -2 For end of data file
For each game print out all ten frames. For each frame print out the following:
  1. the number of pins knocked down for each ball.
  2. If the frame was a strike or a spare.
  3. The running score for the player.
For extra credit use the "traditional" format for a bowling score sheet.
Name:  John Doe
__________________________
| |X| |/| |6| |X| |2| |1|
| 20| 36| 42| 54| 56| 57|     ....
|---|---|---|---|---|---|_

Remember that after the last frame, up to two additional balls may be played. (Two for a strike and one for a spare.) Mark your output with: Place the lab in the instructor hand in box in BUS R6E, the "terminal room".
Instructor: ltaber@pima.edu** Red's Home page** The Pima College Site

Prev Up Next