Outlab 5: Bowling
Due: Friday 8 April at 6 pm
Purpose
The purpose of this programming assignment is to help you
gain experience using 1D Arrays.
Partners
This is an individual assignment, though collaboration (not
solution sharing) is allowed.
Assignment
Write a program that simulates and scores a game of bowling. As background
information, here is an explanation of terminology and scoring.
For this assignment, assume that a game of bowling can contain one or
more frames (instead of the standard ten).
Instructions
- Create a BlueJ project named Outlab5.
- Create a class named Driver and copy
this code into that class.
Do not modify this class at all.
- Supply the missing Bowling class such
that when the main method of the Driver class
is run, this output is produced.
Note: match the output format exactly!
Hints and Assumptions
- Make sure that you understand the provided Driver class before
designing a solution for the Bowling class.
- You may assume that the constructor of the Bowling class is
called with valid bowling scores and the correct number of
frames in the game.
- Design first. Translate into a programming language (Java) second.
- When the final frame contains a strike or spare,
the frame needs to be printed differently. Please study
the output transcript above carefully to see how.
Grading - 100 points
- 10 points - open frames are scored correctly. All or nothing.
- 10 points - excepting the final frame, frames with spares are
scored correctly. All or nothing.
- 10 points - if the final frame is a spare, it is scored correctly.
All or nothing.
- 10 points - excepting the final frame, frames with strikes are
scored correctly. All or nothing.
- 10 points - if the final frame is a strike, it is scored correctly.
All or nothing.
- 10 points - excepting the final frame, the output format matches
the output format in the above transcript exactly. There will be a 3
point deduction for each type of mistake up to 10 points.
- 28 points (4 points each) - the output format of the final frame
matches the output format found in the above transcript exactly in any
valid case such as: (1) an open frame, (2) three strikes,
(3) a spare followed by a strike, (4) a spare followed by a non-strike,
(5) a strike followed by a spare, (6) two strikes followed by a
non-strike, and (7) a strike followed by an open frame. Each of the
cases is all or nothing.
- 12 points - the solution is of high quality: object-oriented principles
are used, good programming practices are used, redundant code is avoided,
Javadoc comments are used, etc.
Submission
By Friday 8 April at 6 pm, submit the file Bowling.java into the
appropriate D2L dropbox folder. DO NOT SUBMIT .class
files.
Late submissions receive no credit, but partial credit can
be earned by making an ontime submission.