Your Perfect Assignment is Just a Click Away

We Write Custom Academic Papers

100% Original, Plagiarism Free, Customized to your instructions!

glass
pen
clip
papers
heaphones

Baseball Statistics Project

Baseball Statistics Project

Description

CIS 1115 Assignment 2 Spring 2022

Write a complete Java program including comments to do the following:

Outline:

The program will compute baseball statistics. The program will read in the id number and the won?lost record of a baseball team. It will compute various things about the team, and it will print everything out. Then it will repeat the process for a new team, over and over again, until the entire set of data has been taken care of. At the end, it will print the number of teams.

Here are the details:

1. The program will read in the id number of a team (see step 5 below). The program will read in the number of wins this team has and the number of losses. For example, the program could read in the following three pieces of data–and it will print everything read in:

1234 5 7 [this says team 1234 has 5 wins, 7 losses]

2. The program will compute (and print) the total number of games played, which is simply the number of wins plus the number of losses. The program will also print the number of games remaining in the season, which is 25 minus the total number of games played.

If the total number of games played is exactly 25, the program will print a message saying the season is finished. If the total is less than 25, the program will print how many games are remaining in the season. You can assume that no team has played more than 25 games (see optional 3 below).

For example, for the team shown above, the total number of games played is 12, and there are 13 games remaining (25 – 12 = 13).

3. The program will compute the team’s winning average, which is a decimal value between 0 and 1. The winning average is defined to be the number of games won divided by the total number of games played. For the team shown above, the winning average is 5 / 12 = 0.4167. The program should print this out as shown above, with exactly 4 decimal places.

4. The program will compare the number of games remaining to both the number of games won and the number of games lost, printing two separate messages–one for each comparison. (Each question below must have a single message printed for it.)

First, the program will determine whether or not the number of games remaining is greater than or equal to the number won. Print an appropriate message in either case.

Then the program will determine whether or not the number of games remaining is greater than the number lost; it will print an appropriate message in either case.

Note that these two questions are not the same. And note carefully the phrasing of the two questions—if possible, use my phrasing. You must test all of the four possible combinations of yes/no answers to these questions – see below.

5. Then the program should skip a few lines of output and repeat the entire series of steps for the next team, and so on, until the last team has been processed. You must decide how to recognize that the last team has been processed.

6. At that point, print the total number of teams in the league, then stop.

DATA: Read in data for at least 8-10 teams. Make sure that at least three teams have completed their season, and at least five have not. Have at least three teams with more wins than losses, at least two with an even record, and at least three with more losses than wins. Have a team with the number of wins equal to the number remaining, and have a team with the number of losses equal to the number remaining. Have a team with all wins, and have a team with all losses. (You may read data interactively or from a file. If you use an external file, print and hand in a copy of the data.)

Make sure that every possible path is covered by a set of data.

Here is a complete set of output for a typical team:

team 9867

4 wins 12 losses

total number of games played is 16 9 games remaining

the winning average is 0.2500

number of games remaining is greater than or equal to number won

number of games remaining is not greater than number lost

OPTIONALS: 1. For each team that has not completed the season, compute the team’s record if it wins all of the remaining games (give the won-lost record and the winning average), and the record if it loses all of the remaining games.

2. Keep track of the team with the best winning average that is not exactly 1. Print this out at the end. Do the same just for those teams that have completed their season.

3. If a team has completed more than 25 games, print an error message, ask the user to type in new data (repeat if necessary). Do NOT process the original set of data.

Our Service Charter

1. Professional & Expert Writers: Writing Expert only hires the best. Our writers are specially selected and recruited, after which they undergo further training to perfect their skills for specialization purposes. Moreover, our writers are holders of masters and Ph.D. degrees. They have impressive academic records, besides being native English speakers.

2. Top Quality Papers: Our customers are always guaranteed papers that exceed their expectations. All our writers have +5 years of experience. This implies that all papers are written by individuals who are experts in their fields. In addition, the quality team reviews all the papers before sending them to the customers.

3. Plagiarism-Free Papers: All papers provided by Writing Expert are written from scratch. Appropriate referencing and citation of key information are followed. Plagiarism checkers are used by the Quality assurance team and our editors just to double-check that there are no instances of plagiarism.

4. Timely Delivery: Time wasted is equivalent to a failed dedication and commitment. Writing Expert is known for timely delivery of any pending customer orders. Customers are well informed of the progress of their papers to ensure they keep track of what the writer is providing before the final draft is sent for grading.

5. Affordable Prices: Our prices are fairly structured to fit all groups. Any customer willing to place their assignments with us can do so at very affordable prices. In addition, our customers enjoy regular discounts and bonuses.

6. 24/7 Customer Support: At Writing Expert, we have put in place a team of experts who answer all customer inquiries promptly. The best part is the ever-availability of the team. Customers can make inquiries anytime.

Our Service Charter

1. Professional & Expert Writers: Writing Expert only hires the best. Our writers are specially selected and recruited, after which they undergo further training to perfect their skills for specialization purposes. Moreover, our writers are holders of masters and Ph.D. degrees. They have impressive academic records, besides being native English speakers.

2. Top Quality Papers: Our customers are always guaranteed papers that exceed their expectations. All our writers have +5 years of experience. This implies that all papers are written by individuals who are experts in their fields. In addition, the quality team reviews all the papers before sending them to the customers.

3. Plagiarism-Free Papers: All papers provided by Writing Expert are written from scratch. Appropriate referencing and citation of key information are followed. Plagiarism checkers are used by the Quality assurance team and our editors just to double-check that there are no instances of plagiarism.

4. Timely Delivery: Time wasted is equivalent to a failed dedication and commitment. Writing Expert is known for timely delivery of any pending customer orders. Customers are well informed of the progress of their papers to ensure they keep track of what the writer is providing before the final draft is sent for grading.

5. Affordable Prices: Our prices are fairly structured to fit all groups. Any customer willing to place their assignments with us can do so at very affordable prices. In addition, our customers enjoy regular discounts and bonuses.

6. 24/7 Customer Support: At Writing Expert, we have put in place a team of experts who answer all customer inquiries promptly. The best part is the ever-availability of the team. Customers can make inquiries anytime.