Question
Employee requirements: The class should be abstract. getMonthlyPay and getStatus should be abstract. calculateMonthlyPay should deduct 10% tax from the monthly pay and return the
Employee requirements:
The class should be abstract.
getMonthlyPay and getStatus should be abstract.
calculateMonthlyPay should deduct 10% tax from the monthly pay and return the result. (Note that you can call the abstract getMonthlyPay method!)
toString should return a string representation using the following format: IDNum:
FullTimeEmp requirements:
getMonthlyPay should return the salary.
getStatus should return Full time employee
No other methods from parent should be overridden.
PartTimeEmp requirements:
getMonthlyPay should return rate * hours.
addHours should increase the hours instance variable by amount specified.
getStatus should return Part time employee
calculateMonthlyPay should override parent class such that, after the calculation, the hours are reset to zero. It should call calculateMonthlyPay in the parent class to get the calculated monthly pay.
Employee -name: String IDNum: String +Employee (name String,id:String) +getIDNum): String +getName String +calculateMonthlyPay ): double +toStr): String +getMonthlyPay double +getStatus (: String FullTimeEmp PartTimeEmp -salary: double +FullTimeEmp (name: String, id: String, salary:double) +getStatus ): String +getMonthlyPay) double -hours: int -hourlyRate: double PartTimeEmp (name: String, id:String, rate:double) +addToHours (amount :int) +calculateMonthlyPay double +getStatus ): String +getMonthlyPay) doubleStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started