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
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...
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.](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Ff893683d-d70a-429c-ae30-ce98a9dc5e96%2Ff15c356e-3be0-43e3-8fbd-e327e3b7cab8%2Fuhuqon_processed.png&w=3840&q=75)
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

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 3 steps with 2 images

Recommended textbooks for you

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 Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science

Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning

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 Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science

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
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning

Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education

Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY