Problem Set 6#
Task I: CodingBat#
https://codingbat.com/prob/p165321
https://codingbat.com/prob/p195669
两道题目都通过后,开始完成下面题目。
Task II: Employee Payment#
Write a program that asks the user to enter their name, pay rate (in $/hr) and the number of hours the employee worked this week and outputs the amount of money the employee made that week. The standard work week is 40 hours. If an employee works more than 40 hours, they are paid time and a half for the hours they work over 40.
For example, an employee making $10/hour who works 50 hours in a week makes 40 x $10 = $400 for the regular 40 hours they worked, plus 10 x $15 = $150 for the 10 overtime hours they worked. (Note that $15/hour is 50% more than the standard rate of $10/hour.) Output should be a sentence with the employee’s name and how much they got paid for the week.
Sample Program Run
What is the employee’s name?
Dan
What is the employee’s pay rate ($/hr)?
6
How many hours did the employee work this week?
44
Dan gets paid $276.0 this week.
Task III: Who is the winner#
Write a program that asks the user to enter the names and times (in seconds) for 3 people entered in the 100 meter dash. Your program should print out the name of the winner. You are guaranteed that no one will tie with anyone else, so that there will always be a clear winner.
Sample Program Run
Runner #1, what is your name?
Johanna
What was your time?
11.4
Runner #2, what is your name?
Robbie
What was your time?
12.2
Runner #3, what is your name?
Eva
What was your time?
10.9
The winner of the race was Eva!
Submit:#
For Task I, take a screenshot of the https://codingbat.com/python/Logic-1. The problem should has a green check mark besides it.
For Task II and III, put all your work into one python file, and share your project link via 钉钉作业本.
Please submit by Nov 11th, 22PM.