Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Untitled File Edit Format View Help Implement a Team class has an aray of Players. Specifically, it has the following private attributes: -Player lU players
Untitled File Edit Format View Help Implement a Team class has an aray of Players. Specifically, it has the following private attributes: -Player lU players an array ot Players -maxPlayers (int) /this is the maximum number of players a team can have -cuITPlayers (int) this is the current number of players that the team has -wins (int) number of wins for the team losses (int) number of loses for the team ...--and the following methods: Constructor -sets the name and maximum number of players from defined value:s -initializes the players array to the max umber of players -sets the curPlayers, wins and losses to 0 -Get and set methods. -toString method returns the name of the team and wins and losses -addPlayer (Player) method adds the passed in player to the array if there is room (if there is no room, then it is not added. Don't forget to update the current number of players if you successfully add a player printTeam which prints the name of the team, followed by each player on the team on a new line (you can use the player's own toString method to print the information) Then create a TeamDemo class to create and use Team objects. The demo class contains the main method. Use a Scanner object to create -one Team object by reading in the name of the team and maximmum mumber of players -Then create three Players by reading in the names and positions of the three Players -Print the team (use the toString method) Print all the players on the team (call the printTeam method) Input Team's name, max players, informatino for 3 players all in one ine: Leafs 10 Joe Blain Defence Sara Flask Forward Kent Clark Forward Leafs wins: 0 losses: 0 Team Leafs Joe Blain Position: Defence Sara Flask Position: Forward Kent Clark Position: Forward Activate Windows Go to PC settings to activate Windows. - WRITE THE PROGRAM IN JAVA AM FASSIGNMENT .. _ail 10/31/2018 senipts
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started