Question: Create a class called HockeyPlayer that is a child class of ProPlayer HockeyPlayer should have the following specs: Variables to hold the team name of
Create a class called HockeyPlayer that is a child class of ProPlayer
HockeyPlayer should have the following specs:
Variables to hold the team name of the player and the bonus pay of the player
A constructor that takes in and stores the players name(think super here), team name, and bonus pay
A method that returns the calculated pay of the player using the base pay plus the bonus pay.( the base pay needs to come from the parent class.
A method that overrides the parents method that prints the name but also includes the additional player info. (HINT: you should add to the parents print method by calling it inside the child method)
The Parent Class ProPlayer.java
public abstract class ProPlayer { protected String name; private float baseSalary=0;
public ProPlayer(String name) { this.name = name; }
public float getBaseSalary() { return baseSalary; } public void printName(){ System.out.println(name); } abstract void computePay(); }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
