Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Description ( JAVA ) Create a class called BowlingScores. It will use an attribute which is an array. The array will have 1 6 slots,

Description (JAVA)
Create a class called BowlingScores. It will use an attribute which is an array. The array will have 16 slots, one for each team in a 16-team bowling league. The value in each slot will be the total for all bowlers on the team for a 3-game series.
Your constructor will create the array and read a file whose name is the input parameter of the method. The file will contain four columns of data, separated by tabs. The first column is the team number (1-16). The next three columns of each line is the score of each game for a member of that team. All the results of the team will be togheter, meaning they will appear in consecutive lines in the file. Each team has four players, but sometimes only three may play. In the case that a player was absent, and a team has only three lines of results, the fourth player was treated as a "blind", who will score 150 points for each game..
The file will not have the team results in numerical order. Instead, the two teams who played each otehr will be right after the other. For instance, if Team 2 played Team 5, the four lines of results for Team 5 will immediately follow the four lines for Team 2.
Lopp through the file, reading each line. Remember that you main have only three lines for a particular team, so do not automatically read four lines for a team. Total up all of the games (inscluding the scores for a "blind") and place that total into the appropriate slot of the array (Team 1's scores go into index 0, Team 2's scores into index 1, etc). Keep track of which team played which. You can use whatever structure you wish in order to do that.
Tour class will have one more method, printResults. This method, which has no input parameters and no return value. This method will print the results of each team matchup, one matchup per line. For instance, if Team 2 beat Team 5, it will print that. Since there are 16 teams, that makes eight matchups, so this method will print eight lines. The winner of a matchup is the team that produced the highest total score among all of the players (which is the value in that team's slot in the array).
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Algorithmic Trading Navigating The Digital Frontier

Authors: Alex Thompson

1st Edition

B0CHXR6CXX, 979-8223284987

More Books

Students also viewed these Databases questions

Question

Explain the various reasons why some people become micromanagers.

Answered: 1 week ago