Staff # name: String # id: int PartTimer + Staff() + Staff(name: String, id: int) skillLevel: int + getName (): String + getId (): int + calculatePay () : double + toString (): String hoursWorked: int + Part Timer (name: String, id: int, skillLevel: int, hoursWorked: int) + getskillLevel(): int + getHours Worked () : int + tostring () : String java.lang.Comparable compareTo (o: Object): int Figure 1: The relationship between staff, PartTimer and Comparable Skill Level / Tahap Kemahiran Pay Rate Per Hour/ Kadar Bayaran Per Jam 0 ( Basic / Asas) RM50.00 1 (Moderate / Sederhana) RM100.00 RM150.00 2 (Expert / Mahir) Table 1: Skill level and the pay rate per hour Write a complete Java program to create PartTimer class and test class based on the Figure 1, Table 1 and the following requirements: Partimer class is derived from staff and implements Comparable Interface. The calculate Pay()method from the staff class will be implemented in the subclass to calculate the employee's pay. The pay for PartTimer is based on the skill level of staff as shown in Table 1, which is the payment can be calculated by multiplying hours worked with the pay rate per hour. The method tostring () will return the information of PartTimer object. The PartTimer class implements compareTo () method from java.lang.Comparable interface to compare the payment of Then write a test program that creates two PartTimer objects using parameterized two objects. constructor with any values assigned to their data fields. Then display all the information includes the comparison result of the payment for these two objects. #Java

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
Staff
# name: String
# id: int
PartTimer
+ Staff()
+ Staff(name: String,
id: int)
skillLevel: int
+ getName (): String
+ getId (): int
+ calculatePay () : double
+ toString (): String
hoursWorked: int
+ Part Timer (name: String,
id: int,
skillLevel: int,
hoursWorked: int)
+ getskillLevel(): int
+ getHours Worked () : int
+ tostring () : String
java.lang.Comparable
compareTo (o: Object): int
Figure 1: The relationship between staff, PartTimer and Comparable
Skill Level / Tahap Kemahiran
Pay Rate Per Hour/ Kadar Bayaran Per Jam
0 ( Basic / Asas)
RM50.00
1 (Moderate / Sederhana)
RM100.00
RM150.00
2 (Expert / Mahir)
Table 1: Skill level and the pay rate per hour
Write a complete Java program to create PartTimer class and test class based on the Figure 1, Table 1
and the following requirements: Partimer class is derived from staff and implements Comparable
Interface. The calculate Pay()method from the staff class will be implemented in the subclass to
calculate the employee's pay. The pay for PartTimer is based on the skill level of staff as shown in
Table 1, which is the payment can be calculated by multiplying hours worked with the pay rate per hour.
The method tostring () will return the information of PartTimer object. The PartTimer class
implements compareTo () method from java.lang.Comparable interface to compare the payment of
Then write a test program that creates two PartTimer objects using parameterized
two objects.
constructor with any values assigned to their data fields. Then display all the information includes the
comparison result of the payment for these two objects.
#Java
Transcribed Image Text:Staff # name: String # id: int PartTimer + Staff() + Staff(name: String, id: int) skillLevel: int + getName (): String + getId (): int + calculatePay () : double + toString (): String hoursWorked: int + Part Timer (name: String, id: int, skillLevel: int, hoursWorked: int) + getskillLevel(): int + getHours Worked () : int + tostring () : String java.lang.Comparable compareTo (o: Object): int Figure 1: The relationship between staff, PartTimer and Comparable Skill Level / Tahap Kemahiran Pay Rate Per Hour/ Kadar Bayaran Per Jam 0 ( Basic / Asas) RM50.00 1 (Moderate / Sederhana) RM100.00 RM150.00 2 (Expert / Mahir) Table 1: Skill level and the pay rate per hour Write a complete Java program to create PartTimer class and test class based on the Figure 1, Table 1 and the following requirements: Partimer class is derived from staff and implements Comparable Interface. The calculate Pay()method from the staff class will be implemented in the subclass to calculate the employee's pay. The pay for PartTimer is based on the skill level of staff as shown in Table 1, which is the payment can be calculated by multiplying hours worked with the pay rate per hour. The method tostring () will return the information of PartTimer object. The PartTimer class implements compareTo () method from java.lang.Comparable interface to compare the payment of Then write a test program that creates two PartTimer objects using parameterized two objects. constructor with any values assigned to their data fields. Then display all the information includes the comparison result of the payment for these two objects. #Java
Expert Solution
steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY