Question: Lab 2 Learning Outcomes: Create assignment statements by using arithmetic and comparison operators. Apply knowledge of conditional keywords if, elif, and else. Use a decision
Lab 2 Learning Outcomes: Create assignment statements by using arithmetic and comparison operators. Apply knowledge of conditional keywords if, elif, and else. Use a decision table to create conditional statements. Problem Description In this lab, you are to complete a Python program that, when completed, will compute employee wages for a company. The input to the program is the hours an employee worked in a week and the regular hourly pay rate of the employee. The output of the program is the gross pay, deduction, and net pay of the employee for the week. The minimum hourly pay rate for the company is $7.75. The regular weekly hours for an employee is 40, but the range of hours an employee of the company can work each week is between 0 and 100, inclusive. When an invalid value is entered, the program will display a message and terminate. Hours over 40 are overtime hours and will be paid one time and half of the regular hourly rate of the employee. The deduction is computed based on the decision table listed below. The net pay is the difference of the gross pay and the deduction. Computation of Deduction Decision Table Gross Pay Deduction More than And at most -- 1,024 0 1,024 1,517 (Gross Pay 1024) * 15% 1,517 2,300 (75.85 + (Gross Pay 1517) * 30% 2,300 -- 309.95 + (Gross Pay 2300) * 45%
The lab03.py is a partial solution to the problem. You should copy this file from Canvas and complete the program by following the DO tasks. There are 6 DOs, but DO number 6 has three steps. Complete each DO task according to the comments. Do not change any other part of the program! Two interactive sample runs are given below. Blue text is the users input. ---------------------------------------------------------------- Sample run 1 Enter hours worked: 40 Enter pay rate: 7.749 Invalid rate: 7.749 ---------------------------------------------------------------- Sample run 2 Enter hours worked: 7.75 Enter pay rate: 40 The gross pay: $310.00 The deduction: $0.00 The net pay : $310.00 ---------------------------------------------------------------- Sample run 3 Enter hours worked: 40.01 Enter pay rate: 37.92 The gross pay: $1517.37 The deduction: $75.96 The net pay : $1441.41 ----------------------------------------------------------------
Sample run 4 Enter hours worked: 100 Enter pay rate: 17.7 The gross pay: $2301.00 The deduction: $310.40 The net pay : $1990.60 ---------------------------------------------------------------- Sample run 5 Enter hours worked: 52 Enter pay rate: 50.00 The gross pay: $2900.00 The deduction: $579.95 The net pay : $2320.05 ---------------------------------------------------------------- Sample run 6 Enter hours worked: -10 Invalid hours: -10
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
