Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Problem 2: Description: The total wage of an employee in a week depends on the r

ID: 3683126 • Letter: P

Question

Problem 2: Description: The total wage of an employee in a week depends on the regular hourly pay rate and the total hours worked in the week. Additionally, any hours worked over 40 hours is counted as overtime, and the overtime hourly pay rate is 1.5 times the regular hourly pay rate. Write a program that allows a user to input a pair of numbers regular hourly pay rate and the total hours worked in the week for any number of employees. For every entered pair the program must display the total wage of that employee for that week. Eilename Specification: The solution for this problem must be coded in a file named two py Input Specification: The is asked the question "Do you want to enter data for an employee? Answer with y for yes or any other letter for no If the user enters any letter other than 'y', the program finishes. If the user enters 'y the loop iterates one more time and lets the user enter data for that employee. In the data entry part for the single employee, the first prompt takes the regular hourly pay rate (float number) and uses the prompt "Enter regular hourly pay rate: and the second input (also a float number) takes the total hours worked in the week and must use the prompt "Enter total hours worked in the week: Output Specification: Following the data entry (regular pay rate and total hours worked in the week see above) for a single employee, the loop must print the total week's wage for that employee with the descriptive string "Total wage for the week for employee number N S", where Nis a counter (must be an integer on each iteration) that starts at l with the first employee that was processed. The value after the S must be rounded to two digits after the decimal point since it is a money amount.

Explanation / Answer

while True:
print("Do you want to enter Data for an Employee? (Q)uit")
choice = raw_input(">>> ").lower().rstrip()
if choice=="q":
break
else:
   rateFunction();

def rateFunction():
hour = int(input('Enter regular hourly pay ratePerHour: '))
ratePerHour = int(input('Enter total hour worked in week:'))
if hour > 40:
newRate = 1.5 * ratePerHour
newTime = (hour-40) * newRate
hour = 40
else:
newTime = 0
  
regular = hour * ratePerHour
  
total=regular + newTime;
  
print("Total wage for the week of employee is:"+total);

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote