Please enable JavaScript to use CodeHS

Automated Bowling Score

In this project, students will use classes in Java to create an automated bowling scoring system.

Hard

6 Hours

High School

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 the scoreFrame and the scoreBonus for the extra balls in the tenth frame. You should also have getters for the name and score.
  • Game class should store an ArrayList of Player objects as well as the current frame. Your program should have a playGame method to play out the game and print scores between frames. The playGame method should call the playFrame method to play one frame. If it is the 10th frame a bonusFrame method should be called to process a spare/strike in the 10th frame.
  • Bowler class will create a Game object and prompt the user for the player names. Once the Player objects are set, the game will be started from the Bowler class.

Project Demo

Explore this program before assigning it!

Project Overview

Here is an outline of the project activities: