An Internet service provider sets it's base rate for data transfers in a given month according to market conditions. Customers are billed for data transferred in a given month as follows: Transfers up to and including 100 Gigabytes (GB) are charged this base rate only. Transfers over 100 GB up to and including 1000 GB are charged the base, plus an additional 15% of the base, plus an additional $0.07 per GB for each GB over 100GB. Transfers above 1000 GB are charged simply twice the base. (Use Python) User the Design Reciple to write three functions (bill_small, bill_medium,  bill_large) which each likewise consume an amount of data and a base value, then calculates the charge according to the above schemes.  Bills should be rounded to the nearest cent. Include docstrings! E.g., bill_medium will expect a number between 101 and 1000, and return the base+(15% of base)+$0.07 x (GB over 100). Write at least one assert_equal test for each function assuming a base rate of $80.00.  Write one other assert_equal test for a value of your choosing. For example: Test Result print(float(bill_small(10,80))) 80.0 print(float(bill_large(10000,80))) 160.0 print(round(float(bill_medium(500,80)),2)) 120.0

Systems Architecture
7th Edition
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Stephen D. Burd
Chapter9: Computer Networks
Section: Chapter Questions
Problem 9VE
icon
Related questions
Question

An Internet service provider sets it's base rate for data transfers in a given month according to market conditions. Customers are billed for data transferred in a given month as follows:

  1. Transfers up to and including 100 Gigabytes (GB) are charged this base rate only.
  2. Transfers over 100 GB up to and including 1000 GB are charged the base, plus an additional 15% of the base, plus an additional $0.07 per GB for each GB over 100GB.
  3. Transfers above 1000 GB are charged simply twice the base.

(Use Python) User the Design Reciple to write three functions (bill_smallbill_medium,  bill_large) which each likewise consume an amount of data and a base value, then calculates the charge according to the above schemes.  Bills should be rounded to the nearest cent. Include docstrings!

E.g., bill_medium will expect a number between 101 and 1000, and return the base+(15% of base)+$0.07 x (GB over 100).

Write at least one assert_equal test for each function assuming a base rate of $80.00.  Write one other assert_equal test for a value of your choosing.

For example:

Test Result
print(float(bill_small(10,80))) 80.0
print(float(bill_large(10000,80))) 160.0
print(round(float(bill_medium(500,80)),2)) 120.0
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Network Transmission Cabling
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Systems Architecture
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning