public class Person
public class Person {
private String personID; private String firstName; private String lastName; private String birthDate; private String address;
public Person(){
personID = ""; firstName = ""; lastName = ""; birthDate = ""; address = "";
}
public Person(String id, String first, String last, String birth, String add){ setPerson(id,first,last,birth,add);
}
public void setPerson(String id, String first, String last, String birth, String add){
personID = id; firstName = first; lastName = last; birthDate = birth; address = add;
}
public String getFirstName(){
return firstName;
}
public String getLastName(){
return lastName;
}
public String getBirthdate(){
return birthDate;
}
public String getAddress(){ return address;
}
public void print(){
System.out.print("\nPerson ID = " + personID);
System.out.print("\nFirst Name = " +firstName);
System.out.print("\nLast Name = " +lastName);
System.out.print("\nBirth Date = " +birthDate); System.out.print("\nAddress = " +address);
}
public String toString(){ return personID+" "+firstName+", "+lastName+" "+birthDate+" "+address+" "; }
}
public class PartTimeEmployee extends Person
{
private double payRate;
private double hoursWorked;
public PartTimeEmployee()
{
super();
payRate = 0;
hoursWorked = 0;
}
public PartTimeEmployee(double payRate, double hoursWorked)
{
super();
this.payRate = payRate;
this.hoursWorked = hoursWorked;
}
public String toString(){return;}
public double getPayRate(){return payRate;}
public double getHoursWorked(){return hoursWorked;}
public double calculatePay(){return (payRate*hoursWorked);}
//please continue my code or make it more efficient. Thank you



Step by step
Solved in 2 steps with 1 images









