Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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: Name: MonthlyPay: Status: Note that there is a space between each component. For example: IDNum: 2222 Name: Adam MonthlyPay: 22.50 Status: partTime

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) double

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David M. Kroenke, David J. Auer

7th edition

133544621, 133544626, 0-13-354462-1, 978-0133544626

More Books

Students also viewed these Databases questions

Question

What is scientic psychology?

Answered: 1 week ago