Answer to Question #11438 in Python for Bryant

Question #11438
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)

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS