Question: Write a Python program using IDLE script. Use the constant variable format for the overtime rate initialized to 1.25 number value. Input employee's name into
Write a Python program using IDLE script.
Use the constant variable format for the overtime rate initialized to 1.25 number value.
Input employee's name into string variable called emp_name.
Input regular hours worked into variable accepting fractions. Variable called reg_hrs.
Input overtime hours worked into variable accepting fractions. Variable called ot_hrs.
Input the regular hourly pay rate into variable accepting fractions. Variable called reg_pay_rate.
Calculate the overtime houly pay rate into variable called ot_pay_rate. Use formula reg_pay_rate multiplied by the overtime rate constant variable.
Calculate regular pay into variable called reg_pay. Format US currrency dollar and cents. Hint: reg_hrs multiplied by reg_pay_rate.
Calculate overtime pay into variable called ot_pay. Format US currrency dollar and cents. Hint: ot_hrs multiplied by ot_pay_rate.
Calculate gross pay into variable gross_pay by adding reg_pay to ot_pay. Format US currrency dollar and cents.
Using one function statement and concatenation not commas display employee name,
next line indent regular hours worked, regular hourly pay rate, regular pay,
advance next line, tab indent, overtime hours worked, overtime hourly pay rate, overtime pay,
advance next line, using tab indents line up gross pay. Hint: when printing currency use format 8 positions with comma and 2 decimal places.
Display Example:
Employee: Jerry
Regular Hours Worked: 40.00 Regular Hourly Pay Rate: $20.33 Regular Pay $ 813.20
Overtime Hours Worked: 7.50 Overtime Hourly Pay Rate: $25.41 Overtime Pay $ 190.58
Gross Pay $ 1,003.78
If gross_pay is > 999.99 display "Over one thousand." else if gross_pay => 500.00 display "Between five hundred and one thousand." else otherwise display "Under five hundred."
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
