Question: Write a program to calculate the amount of an employee s paycheck Prompt the user for the hourly rate ( a floating point number )

Write a program to calculate the amount of an employees paycheck
Prompt the user for the hourly rate (a floating point number) and if the employee is hourly or salaried (h/H or s/S)
Salaried employees always paid for 40 hours
Hourly employees need 2 additional pieces of information: number of hours worked (a floating-point number) and if it was a holiday (y/Y or n/N)
Holiday hours are paid at double the hourly rate
When it is not a holiday, hourly employees are paid their normal hourly rate for the first 40 hours and 1.5 for any hours over 40
Output the pay rounded to 2 decimal places
Test #1 checks all output
Mini Test #2 output includes Your weekly pay $800.0
Test #3 checks all output
Mini Test #4 output includes Your weekly pay $200.0
Test #5 checks all output
Mini Test #6 output includes Your weekly pay $1200.0
Test #7 checks all output
Mini Test #8 output includes Your weekly pay $973.24
Test #9 checks all output
Mini Test #10 output includes Your weekly pay $1740.0
Source Test #11 pay.py includes else: to demonstrate use of at least one if-else statement

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!