Computers and Technology

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

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 24.06.2019 00:10, roxymiller3942
Read each statement below. if the statement describes a peer-to-peer network, put a p next to it. if the statement describes a server-based network, put an s next to it. p - peer-to-peer s - server-based
Answers: 1
image
Computers and Technology, 24.06.2019 01:30, kellygaytan
Suppose a cpu with a write-through, write-allocate cache achieves a cpi of 2. what are the read and write bandwidths (measured by bytes per cycle) between ram and the cache? (assume each miss generates a request for one block.)
Answers: 1
image
Computers and Technology, 24.06.2019 11:30, AnwarWeirdLol8811
Why is body language an important factor in a business meeting
Answers: 1
image
Computers and Technology, 24.06.2019 15:00, bsndb5638
Universal windows platform is designed for which windows 10 version?
Answers: 1
Do you know the correct answer?
Develop a java program that a soccer team coach manage the roster of his/her soccer team. to assist...

Questions in other subjects:

Konu
Mathematics, 04.11.2020 16:50
Konu
Mathematics, 04.11.2020 16:50