ava Programming Following the specifications given in the following detailed UML diagram, develop or modify all required classes: Design the Payroll interface, having the following two methods: calculateMonthlyGrossPay(): double displayPayInfo(): void - displays the information of the employee, followed by the information about the pay for a month Modify Person.java to show that it implements Payroll interface - you will not implement the interface methods here, which will change the type of class Person is; Modify Student, Employee, and Faculty to express the fact that they inherit behavior from Person that includes Payroll. You do not implement any of the methods from the Payroll interface in any of these classes.

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter11: Advanced Inheritance Concepts
Section: Chapter Questions
Problem 16RQ
icon
Related questions
Question

 

Java Programming

  1. Following the specifications given in the following detailed UML diagram, develop or modify all required classes:
    • Design the Payroll interface, having the following two methods:
      • calculateMonthlyGrossPay(): double
      • displayPayInfo(): void - displays the information of the employee, followed by the information about the pay for a month
    • Modify Person.java to show that it implements Payroll interface - you will not implement the interface methods here, which will change the type of class Person is;
    • Modify Student, Employee, and Faculty to express the fact that they inherit behavior from Person that includes Payroll. You do not implement any of the methods from the Payroll interface in any of these classes. 
    • Design Graduate class as a subclass of Student. 
      • This class inherits the attributes and behavior of Student. 
      • The class has an additional attribute:
        • department: String - the department student is registered in.
      • Create the accessor and mutator methods for a new attribute.
      • Override the method toString() to include information about the new attribute.
    • Design GTA class, standing for Graduate Teaching Assistant, as a subclass of Graduate, to include:
      • hourlySalary: double - holding the GTA salary position
      • Accessor and mutator methods for hourlySalary
      • calculateMonthlyGrossPay(int weeklyHours): double 
      • displayPayInfo(): void 
      • Do not override the toString method of superclass Graduate. The payment information will be only accessed to specific payroll methods
    • Design FullTimeFaculty class to include attributes and methods:
      • salary: double
      • Accessor and mutator methods for salary
      • implementation of both methods in the Payroll interface
      • Do not override the toString method of superclass Faculty. The payment information will be only accessed to specific payroll methods.
    • Design AdjunctFaculty class to include attributes and methods:
      • perCreditRate: double
      • Accessor and mutator methods for perCreditRate
      • Implementation of both methods in the Payroll interface. For adjunct faculty, the salary for a semester has two pays, so it will be calculated as noCredits*perCreditRate/2
      • Do not override the toString method of superclass Faculty. The payment information will be only accessed to specific payroll methods
  2. Create  a driver program similar to the one given in the guided assignment 3, named Personnel.java, that includes:
    • Define and instantiate three objects as follows:
      • p1  - type GTA, working 40 hours
      • p2 - type FullTimeFaculty paid for 4 weeks
      • p3 - type AdjunctFaculty paid for 12 credits
  3. Display information about all object declared.
  4. Display the payment information for a month.
  5. Compile all classes, run the driver program, and take a snapshot of the result.
  6. If you implement all the required methods properly, the driver program should generate outputs similar to the following:
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 5 steps

Blurred answer
Knowledge Booster
Data members
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT