Create a parent class called ProPlayer ProPlayer should have the following specs
ID: 3884788 • Letter: C
Question
Create a parent class called ProPlayer
ProPlayer should have the following specs:
A protected string variable to take in a player’s name
A private base salary variable set to a specified amount of your choosing.
A constructor that takes in the player’s name
A public method thaty returns the base salary you have defined
A method that prints the players name
An abstract method that for computing pay
Explanation / Answer
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();
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.