I have a hmwk assignment that i'm stuck on....It calls for a while loop so I need to basically repeat this 4 times but I cannot for the life of me figure it out....any help would be great I narrow the code down so it works when I input the hours and rates...I just need to repeat this
Make a flowchart and write the Python 3.0 program for the following problem. A list of employees names, hours worked in a week and the hourly rate of pay is entered. Read in each employee’s data and print out the pay for the week ( including 1.5 times overtime pay for hours over 40). At the end, print the total pay for all employees. Some sample data is shown below (with the corresponding output). Hint: First write a while loop to read in employee data (one employee at a time) and print it. Then enhance your work to process an employee without overtime pay. Then include overtime pay and finally, produce the total pay.
Run#1:
Input:
“John Smith”, 50, 10
“Jane Doe”, 40, 15
“Mark Manning”, 60, 12
“ “, 0, 0
Output:
John Smith’s pay=$550.00
Jane Doe’s pay=$600.00
Mark Manning’s pay=$840.00
Total pay=$1990.00
#This program calculates and prints pay given
#rate and hours worked
employeeName=str(input("Enter employee name: "))
rate=float(input("Enter rate: "))
hours=float(input("Enter hours worked: "))
if hours>40:
pay = 40 * rate + (hours - 40) * 1.5 * rate
if hours>40:
overtime=(hours - 40) * 1.5 * rate
print("For this week overtime earned $",overtime)
else:
pay = hours * rate
overtime=(hours - 40) * 1.5 * rate
print("For this week overtime earned $",overtime)
print("For this week you earned $",pay