Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a Java class that implements the concept of a sports team (SportsTeam class) that has the following components: Attributes: Mascot, City, Wins, and Losses
Write a Java class that implements the concept of a sports team (SportsTeam class) that has the following components: Attributes: Mascot, City, Wins, and Losses Constructor that initializes Mascot and City attributes. Getter and Setter methods are required for all four attributes. Inside a test class (TestSportsTeam), do the following: Create an array of 4 sports team objects with the following arrangement of objects: object team I: Mascot = "Falcons", City=" Atlanta" object team2:Mascot ="Bucs", City='Tampa Bay"; Mascot ="Saints", City="New Orleans" Mascot ="Panthers", City="Carolina" For each object, randomly assign a value (no greater than 16) to attribute Wins. Then set the Losses attribute to be equal to 16 - Wins. Next, display a header with the following format (City Mascot Wins Losses WinPct) as shown below. Below the header, display (printout) the team that has the most wins and the fewest wins. Compute the win points as follows: WinPct = Wins/(Wins+Losses). Sample output
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