Answer:
total_hours = 0
total = 0
n = int(input("Enter the number of employees: "))
for i in range(n):
pay = int(input("Enter the pay per hour in cents of the " + str(i+1) + ". employee: "))
for j in range(5):
hour = int(input("Enter the work hour in " + str(j+1) + ". day: "))
total_hours +=hour
total += pay * total_hours
total_hours = 0
print(total)
Explanation:
Initialize the total hours and total as 0
Ask the user to enter the number of employees
Create a nested for loop. The outer loop iterates depending on the number of employees. The inner loop iterates for each work day.
Inside the outer loop, ask the employee's pay per hour. Then, inside the inner loop, ask for the work hours for 5 days. Sum the hours and assign the value to total hours.
When inner loop is done, multiply the pay with total hours to calculate the pay and add this value to the total for each employee. Also, set the total hours as 0 (For the next employee, total hours will be zero at the beginning).
When the loops are done, print the total