← 返回 doordash 的题目列表Dasher Pay - Code Craft
类型:online_judge
Write a program to calculate the payment a Dasher deserves after completing delivery tasks. Given a list of completed orders by the Dasher, each order contains the following information: order amount, order time, delivery time, and customer satisfaction rating. Use the following rules to compute the payment:
Basic payment is 10% of the order amount.
If delivery time is within 30 minutes, add 5%.
If customer rating is 5, add 10%.
Write code to generate the Dasher's total payment. Consider edge cases and provide test cases for each condition.
Example
Input
[{'amount': 100, 'order_time': '10:00', 'delivery_time': 25, 'rating': 5}]