Bowling Score 2


Collapse Content

Spare

A spare in bowling is when all 10 pins are knocked down in one frame. When there's a spare, the score for the next single bowl is added to the current frame's score. For example, if this is the pins knocked down in the first 2 frames:

1. 8 2 
2. 6 3

...the player's score will be 16 for the first frame and 9 for the second frame, with a total score of 25. The score of 6 gets counted twice, since it was added to the score of the spare too.

Challenge

As before, create a program that prints the scores for each frame and the cumulative score, but this time you need to take into account spares. (There won't be any Strikes.)

Example

You will again be given 20 bowls:

0 3 4 6 0 5 4 6 9 0 8 1 7 3 8 1 9 0 9 0

Print the scores, taking spares into account:

3 10 5 19 9 9 18 9 9 9 100

Challenge

Print the scores of the bowling game, including spares.

Please sign in or sign up to submit answers.

Alternatively, you can try out Learneroo before signing up.

Comments

Contact Us
Sign in or email us at [email protected]