Answered step by step
Verified Expert Solution
Link Copied!
Question
1 Approved Answer

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

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

Students explore these related Databases questions