You are on page 1of 3


You are to write a program to keep track of the scores for a bowling team. Each bowler on the team will bowl
three games. You are to track the average score for each bowler and keep a running average score for the team.
A team can have at most 5 bowlers. You need to be able to print the scores and the average for each bowler on
the team. The score for each game falls between 0 and 300, inclusive.

• The user is first asked for the name of the bowling team. The main screen will now display this team name.
• When the user enters first name, last name and three game scores and then selects the Add Bowler button, the
application updates the Average Score and the Team Average. The user may add only 5 bowlers to the team.
• When the user selects the Print Scores button, the application displays a list of all bowlers with their three
game scores and their average.
• When the user closes the frame or presses the Exit button, the application exits.

• Create a Bowler class. It will contain instance variables for bowler name and game scores. It will contain
the average() and toString() methods. You may add methods as needed.
• Create a Team class. It will contain the team name, 5 Bowler objects, the number of bowlers, etc. It will
contain an addBowler(), printScore() and average() methods. You may add methods as needed. The average
method computes the average of all bowler game score averages.
• Create a Frame class.
• Create a Panel class which implements the ActionListener. Use Layout Managers to make your panel look
more professional
• The averages should be formatted to two decimal places.
• Check that the game scores are between 0 and 300, inclusive. If they are not, use a dialog box to alert the user
and allow the user to correct the error, if it is a numeric error.
• Do NOT use arrays and do NOT allow more than 5 bowlers

Use JOptionPane to
prompt the user for
the name of the team
One bowler
has been

Two bowlers
have been
Three bowlers
have been added

JOptionPane to
display the team