Answered step by step
Verified Expert Solution
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
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: maryamStep 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