64 506
Assignments Done
99,1%
Successfully Done
In September 2018

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.
Expert's answer
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 first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions