This is another getwinloss method demonstrating what is


Program- Sports Team Stats

This assignment expand on the program shell I have provided in the file sports-team.zip. As discussed in class, the program will use four parallel vectors to hold information regarding games played by a given sports team.

Part I

What you need to complete for this part is spelled out in the comments you will find in the SportsTeam class. There are a total of six methods you need to complete, but two of them are trivial (one line of code).

Note that you will need to use type double variables to compute the average.

Part II

First, add two new methods:

public double getHomeWinLoss(boolean printRequest)

This is much like the getWinLoss (...). The only difference is that it will only consider home games and report accordingly.

public double getAwayWinLoss(boolean printRequest)

This is much like the getWinLoss (...). The only difference is that it will only consider away games and report accordingly.

After you complete the two above methods, add lines to the displayRecord() method to include home and away records in the output.

Next, add one more method:

public double getWinLoss(String oneTeam, boolean printRequest)

This is another getWinLoss (...) method, demonstrating what is known as method overloading. The compiler knows the difference between the two different getWinLoss(...) methods because the parameters are different. This method, given a team name will only consider games played against that team and report accordingly. Include the oneTeam name in a descriptive output line.

First, add a method named displaySummary() that will display 1) The home win/loss record, 2) the away win/loss record, and 3) a list of the win/loss records for every team that has been played. No team should appear in this list twice.

Here's the rub: Your code should not assume that the four team names randomly generated by addRandomGames() are the teams that have been played. For one, perhaps not all of those teams were played, and in addition, addGame(...) could have been used with a new team name.

Attachment:- Sports-Team.zip

Request for Solution File

Ask an Expert for Answer!!
Programming Languages: This is another getwinloss method demonstrating what is
Reference No:- TGS01701948

Expected delivery within 24 Hours