In: Computer Science
Python Programming 4th edition: Write a program that asks the user for the number of hours (float) and the pay rate (float) for employee pay role sheet. The program should display the gross pay with overtime if any and without overtime. Hints: Given base_hr as 40 and ovt_multiplier as1.5, calculate the gross pay with and Without overtime. The output should look like as follows: Enter the number of hours worked: Enter the hourly pay rate: The gross pay is $XXX.XX
hoursWorked = int(input('Enter the number of hours worked: ')) payRate = float(input('Enter the hourly pay rate: ')) if hoursWorked <= 40: gross = hoursWorked * payRate else: gross = 40 * payRate + (hoursWorked - 40) * payRate * 1.5 print('The gross pay is $%.2f' % gross)
************************************************** Thanks for your question. We try our best to help you with detailed answers, But in any case, if you need any modification or have a query/issue with respect to above answer, Please ask that in the comment section. We will surely try to address your query ASAP and resolve the issue.
Please consider providing a thumbs up to this question if it helps you. by Doing that, You will help other students, who are facing similar issue.