Question: Write a Java program for the eSports program. Your program should do the following: 1 . Check if there is a file, teamData.txt , to

Write a Java program for the eSports program.
Your program should do the following:
1. Check if there is a file, teamData.txt, to read team data.
a. If the file exists, read the data, and populate the teams list.
b. If the file does not exist, print a message to the console and continue.
2. Print a menu to the console with the following options:
a. Create team.
b. Add player to existing team.
c. Display all teams.
d. Display all players from an existing team.
e. Exit.
3. If Create team is chosen:
a. Prompt the user for the name of the team, the game the team plays, and the number of
players on the team.
b. Create the team and add the team to the list of teams.
c. Return to the main menu.
4. If Add player to existing team is chosen:
a. Print the list of all teams and prompt the user to choose which team they want to add
to.
i. You should validate the users input.
ii. If they choose a team that does not exist, continue to prompt for input.
b. Prompt the user for the players name, age, and rank.
c. Create the player and add the player to the teams player array.
d. Return to the main menu.
5. If Display all teams is chosen,
a. Print the list of all teams name, game, and win-loss ratio.
b. Return to the main menu.
6. If Display all players from existing team is chosen
a. List all teams and prompt the user to choose one.
i. You should validate the users input.
ii. If they choose a team that does not exist, continue to prompt for input.
b. Print all the players names, ages, and ranks to the console.
i. If any of the slots in the players array is empty then print instead.
c. Return to the main menu.
7. If Exit is chosen,
a. Write all the teams information, including their players, to an output file, teamData.txt.
b. End the program

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!