Question: Assignment 4 Write a class called Assignment 4 zhang 1 2 3 4 5 6 that creates two sports team of players, using Player.java. Use
Assignment
Write a class called Assignmentzhang that creates two sports team of players, using
Player.java. Use a method to fill the teams one call to the method for each team Each player
has a surname we are not recording their first name a position, a number, as well as a total
number of goals and assists. Ask the user to enter the info for each player. Ensure the number
is between and Ensure the position is one of F D or G these represent forward, defence,
and goalie Also ensure that there are no more than goalies. The surname can be
anything. Ensure no one has more than goals or more than assists. No one should have a
negative number of goals or assists. Have the user enter 'None' to stop inputting players. Once
the user enters 'None' the first time, you should start asking for players on the second team.
After reading in all the players, print each team out. For each team, print the forwards first,
then the defence, then the goalies with all of their info. Edit the Player.java file to have it return
a total number of points for each player goals assists Note that you should not store the
number of points as instance data, since it is a calculated value.
After printing each team, use a method to print out which team has the most total points. This
method should accept both teams as well as both team names.
write a java code
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
