python Now write another program that reads the text file created in the program above and calculates the user's weekly pay. The program should begin by prompting the user for the regular hourly pay rate. The program should then loop through the file and report the days and hours worked. The program should finish by calling a custom void function named calc_pay that calculates and prints
python
Now write another program that reads the text file created in the program above and calculates the user's weekly pay. The program should begin by prompting the user for the regular hourly pay rate. The program should then loop through the file and report the days and hours worked. The program should finish by calling a custom void function named calc_pay that calculates and prints the weekly pay, including overtime, if applicable. By law, weekly hours in excess of 40 should be paid at 1.5 times the regular hourly rate. The calc_pay function takes two arguments, total hours and hourly pay rate, and it must be imported from a separate module file. Note that three outputs are required for the pay.
Sample Output 1
Enter your hourly pay rate 25.00
Here are your hours this week
Monday hours : 10.0
Tuesday hours : 8.0
Wednesday hours : 12.0
Friday hours : 12.0
Saturday hours : 8.0
You worked 50.0 hours this week
You worked 10.0 hours overtime
Your hourly pay rate is $25.00
Regular pay : $1,000.00
Overtime pay : $375.00
Total pay : $1,375.00
Sample Output 1 (for a different work week)
Enter your hourly pay rate 25.00
Here are your hours this week
Monday hours : 10.0
Wednesday hours : 12.0
Friday hours : 12.0
You worked 34.0 hours this week
Your hourly pay rate is $25.00
Regular pay : $850.00
Overtime pay : $0.00
Total pay : $850.00
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 3 images