Question: write a java program that creates a class called HockeyTeam 2. For your HockeyTeam class add the following data propertires: String city; String name; int

write a java program that creates a class called HockeyTeam

2. For your HockeyTeam class add the following data propertires:

String city;

String name;

int wins;

int loss;

3. add a no argument constructor that sets these initial vales:

city= " ";

name= " ";

wins=0;

loss=0;

4. add getters and setters for each of these data properties.

5. add a method called calcPerc() with the following signature: public double calcPerc ( ) {

it should return the result of (double) wins/(wins+loss)*100;

6. write a test program that creates 2 Hockey teams:

1. the first with team name "BlackHawks" from "Chicago" with 33 wins and 39 losses

2. the second with team name "PRedators" from "Nashville" with 53 wins and 18 losses

7. display each team name, city, wins, losses, and WinPercent like this:

Team:BlackHawks city:Chicago wins:33 losses:39 WinPerc: 45.83

Team:Preditors city:Nashville wins:53 losses:18 WinPerc:74.65

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 Databases Questions!