Question: can you do it with a comments please and thank u. Write an Object-Oriented program incorporating abstraction, encapsulation, polymorphism and interface that uses an array

can you do it with a comments please and thank u.can you do it with a comments please and thank u. Writean Object-Oriented program incorporating abstraction, encapsulation, polymorphism and interface that uses an

Write an Object-Oriented program incorporating abstraction, encapsulation, polymorphism and interface that uses an array of Employee as an attribute of a Payroll object with each of the following kinds of employees: Contractor o name: to be read from the user hourly rate: to be read from the user o hours per week: to be read from the user o tax: 15% (that is, 0.15) Regular name: to be read from the user annual salary: to be read from the user deduction: 17% (that is, 0.17) Write an interface Employee with an attribute that represents the name of the company and with abstract methods to read details of an employee, process the payroll and to print the details. Name of the company should be your name plus the word tech (Example: AnuTech). Also write Regular and Contractor classes that uses Employee interface. These classes represent regular and contractor employees. The constructor for your Regular and Contractor classes will set the tax rate and deduction rate accordingly. The method that reads details from the user will read details like employee's name, annual salary, hourly rate, hours per week etc. as required. The method that does the payroll calculation should return the calculated amount. The print method should get the return value of calculation method as a parameter. Contractor class should have a private method that calculates the tax amount. This method should return the tax amount. This method will be called by the print method to print the tax that the contractor has to remit. The Payroll class will have an array of Employee objects as its attributes. This class will do two things: 1. add employees: Ask the user to enter the type of employee - Regular or Contractor. If the user opts some other option other than Regular or Contractor, print an error message. You need to repeat the process of reading the type of employee until you get a valid input- Regular or Contractor. (See expected output). Read the details of the employee. 2. process payroll: This method will process the payroll for all employees and prints the details. Amount will be sent to the print method as a parameter. PayrollTest class: In the main method, read from the user the number of employees in the company. Then, create a Payroll object as required. With the created object, invoke methods for adding employees and processing details

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!