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, 23.06.2019 09:30
Which of the following tasks is an audio technician most likely to perform while working on a nature documentary? (select all that apply). eliminating potentially distracting background noise adding sound effects making sure the lighting is adequate for a particular scene changing the narration to better match the mood of the documentary
Answers: 3
question
Computers and Technology, 23.06.2019 12:30
How is the brightness of oled of the diaplay is controled
Answers: 1
question
Computers and Technology, 23.06.2019 17:10
Ac++an of of pi. in , pi is by : pi = 4 – 4/3 + 4/5 – 4/7 + 4/9 - 4/11 + 4/13 - 4/15 + 4/17 . ., to pi (9 ). , if 5 to pi,be as : pi = 4 - 4/3 + 4/5 - 4/7 + 4/9 = 4 – 1. + 0.8 - 0. + 0. = 3.. atoofbe to pi?
Answers: 2
question
Computers and Technology, 23.06.2019 18:30
Janice recently received her college degree and is looking for a job. she is worried that since she just finished school, she will be required to repay her perkins and direct subsidized loans immediately. janice pulls out the paperwork she signed and reviews it again for repayment information. after reading all of the information, janice discovers that
Answers: 2
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
Questions on the website: 13722360