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
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