subject

Develop a java program that a soccer team coach manage the roster of his/her soccer team. to assist with developing this program you have been provided with a class name player that uses an enumerated type position that represents one of three positions that a player might occupy (where the goalkeeper is included among the defenders):
code given:
enum position {defender, midfielder, forward};
class player { public player(string name, position position) {
this. name = name; this. position = position; }
string name; position position;
public string getname() {
return name; }
public void setposition(position position) {
this. position = position; }
@override
public string tostring() {
// you will need to write this method. } }
the program must have the following five options, displayed in a menu: 1. print player list. 2. add player to roster. 3. remove player from roster. 4. change player’s position. 5. quit. use an arraylist of player objects to represent the roster of players. a transcript of a sample run of the program is shown below. you will also need to fill in the body of tostring method for the player class to match the sample output (i. e., return "playername: playerposition"; ).
in terms of error-handling, your program only needs to handle the following bad input:
• invalid menu option (i. e., not 1–5). simply ignore the bad input and redisplay the menu.
• invalid player position (i. e., not 1–3) when adding a player to the roster. ignore all user input and do not cse 114 – summer 2019 lab assignment #10 3 add any player object to the team roster.
• invalid player position (i. e., not 1–3) when modifying the position of a player already on the roster. ignore all user input and do not modify any player object on the team roster.
• invalid player name when attempting to delete a player from the roster or change the position of a player on the roster. ignore all user input and do not delete or modify any player object from the team roster

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 03:20
Which of these is a benefit of social networking? oa. hiding your true identity from friendsob. avoiding talking to people in personoc. spending time with friends instead of studyingod. connecting with new people
Answers: 2
question
Computers and Technology, 23.06.2019 01:50
Free points just awnser this. what should i watch on netflix
Answers: 2
question
Computers and Technology, 23.06.2019 17:30
Per the municipal solid waste report, what are the most common sources of waste (trash
Answers: 3
question
Computers and Technology, 23.06.2019 21:00
Which task uses a simple parameter?
Answers: 1
You know the right answer?
Develop a java program that a soccer team coach manage the roster of his/her soccer team. to assist...
Questions
question
Mathematics, 16.09.2019 06:50
Questions on the website: 13722360