Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

can you please solve this python coding question . Q2. Create a class Regular Pay that has the following data attributes pay Rate: float (KWD

image text in transcribed

can you please solve this python coding question

. Q2. Create a class Regular Pay that has the following data attributes pay Rate: float (KWD per hour) name: String The class should also have: a constructor that initializes the name and pay Rate. a method computePay(hours) that returns the pay for a given amount of time (payRate*hour). . . . Derive a class Hazard Pay from Regular Pay. It has the following extra data attribute: hazard Rate: float It should: have a constructor that initializes the name, pay Rate, and hazardRate overrides the computePay method. The new method should return the amount returned by the superclass method plus the hazardRate*hour. . Create a testing class for your main program. In this class print a menu to ask the user to enter the information of the employees as shown in the output. Each employee should be added to a list whenever created. You should also allow the user to choose to print all employees' info, compute payment of one employee, exit the program. Refer to the sample output in next page. Sample output What would you like to do? 1- Add Regular Pay employee 2- Add Hazard Pay employee 3- Print employees info 4- Compute payment 5- Exit 1 Enter employee name: Aisha Enter pay rate: 5 What would you like to do? 1- Add Regular Pay employee 2- Add Hazard Pay employee 3- Print employees info 4- Compute payment 5- Exit 3 The employees are: Aisha What would you like to do? 1- Add Regular Pay employee 2- Add Hazard Pay employee 3- Print employees info 4- Compute payment 5- Exit 2 Enter employee name: maryam

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

Step: 3

blur-text-image

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 Processing

Authors: David M. Kroenke, David Auer

11th Edition

B003Y7CIBU, 978-0132302678

More Books

Students also viewed these Databases questions

Question

I receive useful feedback about my performance.

Answered: 1 week ago

Question

I am encouraged to offer opinions/suggestions.

Answered: 1 week ago