public class Person

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
100%

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


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
Transcribed Image Text: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
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
Transcribed Image Text: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
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education