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

Fundamentals of Information Systems
9th Edition
ISBN:9781337097536
Author:Ralph Stair, George Reynolds
Publisher:Ralph Stair, George Reynolds
Chapter4: Networks And Cloud Computing
Section: Chapter Questions
Problem 2SAT
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
Fundamentals of Information Systems
Fundamentals of Information Systems
Computer Science
ISBN:
9781337097536
Author:
Ralph Stair, George Reynolds
Publisher:
Cengage Learning
Principles of Information Systems (MindTap Course…
Principles of Information Systems (MindTap Course…
Computer Science
ISBN:
9781305971776
Author:
Ralph Stair, George Reynolds
Publisher:
Cengage Learning
Enhanced Discovering Computers 2017 (Shelly Cashm…
Enhanced Discovering Computers 2017 (Shelly Cashm…
Computer Science
ISBN:
9781305657458
Author:
Misty E. Vermaat, Susan L. Sebok, Steven M. Freund, Mark Frydenberg, Jennifer T. Campbell
Publisher:
Cengage Learning
MIS
MIS
Computer Science
ISBN:
9781337681919
Author:
BIDGOLI
Publisher:
Cengage
Principles of Information Systems (MindTap Course…
Principles of Information Systems (MindTap Course…
Computer Science
ISBN:
9781285867168
Author:
Ralph Stair, George Reynolds
Publisher:
Cengage Learning
Systems Architecture
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning