A new food delivery service opened in Saskatoon called QuickEats. Because of similar services already available in Saskatoon, QuickEats decided to use a different service charge system for the delivery drivers. Instead of charging a flat fee for using their platform, they decided to develop a lucrative service charge formula to attract delivery drivers. This is how they calculate their service charge: • They calculate the average earnings for the day. • Then they sum all the earnings greater than or equal to the average earning. • Finally, they charge 30% of that sum

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Python 

A new food delivery service opened in Saskatoon called QuickEats. Because of similar services already
available in Saskatoon, QuickEats decided to use a different service charge system for the delivery drivers.
Instead of charging a flat fee for using their platform, they decided to develop a lucrative service charge
formula to attract delivery drivers.
This is how they calculate their service charge:
• They calculate the average earnings for the day.
• Then they sum all the earnings greater than or equal to the average earning.
• Finally, they charge 30% of that sum
Here is an example:
Driver A made 8 trips
Earnings from 8 trips
Total earning for the day =
Average earning
Sum of earnings greater than 28.375: (32 +
Service charge 30%
[25, 32, 41, 16, 21, 29, 11, 52]
CAD 227
CAD 28.375
%3D
41 + 29+ 52)
CAD 154
%3D
CAD 46.2
The service_charge() function that makes the calculation above has already been written. It accepts a
list of earnings and returns the service charge. You may peek at this function, but you cannot change it.
Write a test driver with at least 6 test cases for the service_charge () function. You may examine the
function's code, but cannot modify it. Do not create test cases with incorrect data types; stick to attempting
to find logical errors in the function.
Transcribed Image Text:A new food delivery service opened in Saskatoon called QuickEats. Because of similar services already available in Saskatoon, QuickEats decided to use a different service charge system for the delivery drivers. Instead of charging a flat fee for using their platform, they decided to develop a lucrative service charge formula to attract delivery drivers. This is how they calculate their service charge: • They calculate the average earnings for the day. • Then they sum all the earnings greater than or equal to the average earning. • Finally, they charge 30% of that sum Here is an example: Driver A made 8 trips Earnings from 8 trips Total earning for the day = Average earning Sum of earnings greater than 28.375: (32 + Service charge 30% [25, 32, 41, 16, 21, 29, 11, 52] CAD 227 CAD 28.375 %3D 41 + 29+ 52) CAD 154 %3D CAD 46.2 The service_charge() function that makes the calculation above has already been written. It accepts a list of earnings and returns the service charge. You may peek at this function, but you cannot change it. Write a test driver with at least 6 test cases for the service_charge () function. You may examine the function's code, but cannot modify it. Do not create test cases with incorrect data types; stick to attempting to find logical errors in the function.
Expert Solution
steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY