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 4
Write a class called Assignment4zhang123456 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 4 and 79. Ensure the position is one of F, D, or G (these represent forward, defence,
and goalie). Also ensure that there are no more than 3 goalies. The surname can be
anything. Ensure no one has more than 40 goals or more than 60 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
Assignment 4 Write a class called Assignment 4

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!