Write a program to calculate the weekly salary of a worker. Ask the user for the pay per hour for weekdays, and pay per hour on weekends. Then ask user for number of hours worked for each day of the week (i.e. Mon, Tue, … Sun). The program should then display the amount earned that week.
1
Expert's answer
2012-07-06T07:23:02-0400
salaryWeek = input('input salary on weekdays: '); salaryWeekends = input('input salary on weekends: '); hoursWeek = input('hours of work mon: '); hoursWeek += input('hours of work tue: '); hoursWeek += input('hours of work wed: '); hoursWeek += input('hours of work thu: '); hoursWeek += input('hours of work fri: '); hoursWeekends = input('hours of work sat: '); hoursWeekends += input('hours of work sun: '); result = salaryWeek*hoursWeek+salaryWeekends*hoursWeekends; print('amount earned that week = '); print(result)
Comments
Leave a comment