Project Description
Background
In this project, you are going to create a bowling game automatic score system. The user interface will be relatively straightforward, but getting the scoring correct will be a challenge.
Bowling is played in 10 frames. A frame is a set of 2 balls where the player tries to knock down up to 10 pins. If they knock down all 10 on the first ball, then it is called a strike and their frame is done. If they knock down all 10 pins with the 2 balls, it is called a spare.
The score for the frame is the total number of pins knocked down, however, if the player get a strike, they get the 10 plus the number of pins knocked down in the next two balls the player throws (which will be in the next frame or two). If the player gets a spare, they get 10 plus the number of pins knocked down on the next ball (which will be in the next frame).
Your Task
For this project, you will be creating the project using three classes:
Player
class will hold the player’s name and cumulative score. It will also have methods to calculate thescoreFrame
and thescoreBonus
for the extra balls in the tenth frame. You should also have getters for the name and score.Game
class should store an ArrayList ofPlayer
objects as well as the current frame. Your program should have aplayGame
method to play out the game and print scores between frames. TheplayGame
method should call theplayFrame
method to play one frame. If it is the 10th frame abonusFrame
method should be called to process a spare/strike in the 10th frame.Bowler
class will create aGame
object and prompt the user for the player names. Once thePlayer
objects are set, the game will be started from theBowler
class.