Bowling Score 1


Collapse Content

Bowling

A game of bowling consists of 10 frames with two bowls (turns) per frame. The score for each frame is the combined score of the pins knocked down in each bowl. Create a program that will print the scores for each frame of a bowling game, and the total score at the end of the line. In this challenge, there are no strikes or spares.

bowling-pins
Image from Wikipedia

Example

Here's an example game of 20 bowls (which are provided as one array):

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

For the output, just print the sum for each frame (of two bowls) and the total at the end, all on one line:

3 9 5 8 9 9 9 9 7 9 77

Note: Make sure to print each game's scores (space-separated) on its own line.

Challenge

Print the sum of each frame of a bowling game and the total score.

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]