Question: Given the Person class specified in Person.java file, fill in the code for the Employee class in the Employee.java file. public class Person{ private String
Given the Person class specified in Person.java file, fill in the code for the Employee class in the Employee.java file.
public class Person{ private String name; private int age;
public Person(String iName, int iAge){ name = iName; age = iAge; }
public String getName(){ return name; }
public int getAge(){ return age; } }
public class Employee extends Person{ double weeklyBaseSalary; double totalPaid; double totalTaxed; public Employee(String iName, int iAge, double baseSal){ super(iName, iAge); //Code here } /* * Should update the total amount paid/taxed for this employee. * Taxes should be 10% of the weekly base salary for employees under the age of 30 * and 15% for employees aged 30 or older. * The total paid to the employee should be the amount remaining after taxes are paid */ public void pay(){ //Code here } /* * Should return a String representing the employees pay cheque. * The pay cheque must contain the following information: the employees name and age, * the weekly base salary, the amount paid in taxes, the amount paid to the employee. */ public String makePaycheque(){ //Code here return ""; //only included so code will compile } //Add any additional methods you require here }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
