//PLEASE CORRECT MY MISTAKES, THANK YOU 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;
//PLEASE CORRECT MY MISTAKES, THANK YOU
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 variables
private double payRate;
private double hoursWorked;
public PartTimeEmployee()
{
super();
/*invokes the default constructor of class Person
*/
payRate = 0;
hoursWorked = 0;
}
public PartTimeEmployee(String idPerson, String nameFirst, String nameLast,
String date, String addressPerson, double pay, double hours)
{
super(idPerson, nameFirst, nameLast, date, addressPerson);
/*invokes the non-default constructor
in other words, override the parameters from Person() non-defaukt
with another set of parameters, example 'idPerson' variable
overrides 'id' in Person()
*/
this.payRate = pay;
this.hoursWorked = hours;
}
public String toString(String idPerson, String nameFirst, String nameLast,
String date, String addressPerson)
{
return idPerson+nameFirst+nameLast+date+addressPerson;
//not sure about this one, please check
}
public double getPayRate(){return payRate;}
public double getHoursWorked(){return hoursWorked;}
public void setNameRateHours(String idPerson, String nameFirst, String nameLast,
String date, String addressPerson, double pay, double hours)
{
super.setPerson(idPerson, nameFirst, nameLast, date, addressPerson);
this.payRate = pay;
this.hoursWorked = hours;
//not sure about this, please check
}
public double calculatePay(){return (payRate*hoursWorked);}
//this one , calculatePay, not sure if this is the correct formula xD
}
![Person
personID: String
- firstName: String
- lastName: String
- birthDate: String
- address: String
+ Person ()
+ Person (String, String, String, String, String)
+ setPerson (String, String, String, String, String): void
+ getFirstName (): String
+ getlastName (): String
+ getBirthDate: String
+ getAddress: String
+ print (): void
+ toString (): String](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F5ae161f3-c1e0-4ecc-a408-d950a809e955%2F7bd758c2-8fb1-4e8f-a1c2-3e22dd443c88%2Fajb86i_processed.png&w=3840&q=75)
![PartTimeEmployee
|-payRate: double
-hoursWorked: double
+PartTimeEmployee ()
+PartTimeEmployee (String, String,
double, double)
Person
+tostring () : String
+setNameRateHours (String, String,
double, double): void
+get PayRate ((): double
+getHoursWorked (): double
+calculatePay () : double
PartTimeEmployee
FIGURE 11-5 UML class diagram of the class PartTimeEmployee and the inheritance hierarchy](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F5ae161f3-c1e0-4ecc-a408-d950a809e955%2F7bd758c2-8fb1-4e8f-a1c2-3e22dd443c88%2Fup7obnt_processed.png&w=3840&q=75)
![](/static/compass_v2/shared-icons/check-mark.png)
Step by step
Solved in 2 steps
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)