PQR & Company Ltd has two kinds of employees, Permanent and Contractual. The Permanent Employees have monthly
Question:
PQR & Company Ltd has two kinds of employees, Permanent and Contractual. The Permanent Employees have monthly salary and PF which is 15% of salary. Contractual employees have contract periods and contract amounts. Every employee has ID (for permanent employees IDs are like P1001, P1002... and for contractual employees IDs are like C1001, C1002... etc.), name, dept-name. Id for permanent employees will be in even numbers and odd numbers for contractual employee.
- 106, Eric Miller, Finance,35000.00 -> for Permanent employee.
- 111, Roger Steven, Sales,5,750000.00 -> Contractual employee.
Any type of employee needs to pay tax which is 10% of the annual salary. You need to create
- class Employee with private member data
String employee,
String employee name,
String department
Create getter/setter methods and constructors:
calculate tax()-> without body
override toString() in String.format("%-10s %-20s %-15s")
The class must implement a Comparable interface
- class PermanentEmployee inherited from Employee with private member data
Double monthly salary,
Double pf, (15% of monthly salary)
Double tax,
Create getter/setter methods and constructors.
override calculate tax()
override toString() in String.format("%-15s %-15s"...)
Class Contract Employee inherited from Employee with private member data.