Question: Python Your local utility company charges customers for water usage on a tiered system: table [ [ Tier , Charge ] , [ Gallons

Python
Your local utility company charges customers for water usage on a tiered system:
\table[[Tier,Charge],[Gallons 0-5999,$2.35 per 1000 gallons],[Gallons 6,000-20,000,$3.75 per 1000 gallons],[Gallons over 20,000,$6.00 per 1000 gallons]]
No mater the total water usage, the first 5,999 gallons cost $2.35 per 1000 gallons. Any gallons from 6,000 to 20,000 then cost $3.75 per 1000 gallons. Finally, any water usage left will cost $6.00 per 1000 gallons.
Program Inputs
Enter your water usage in gallons:
The user will always enter a positive value, no error checking needed.
Program Outputs
Money owed: $XX.XX
Replace XX.XX with the actual money owed rounded to upto 2 decimal places
Sample Output
Test Case 1:
Enter your water usage in gallons: 1000
Money owed: $2.35
Test Case 2:
Enter your water usage in gallons: 10000
Money owed: $29.1
Test Case 3:
Enter your water usage in gallons: 40000
Money owed: $186.6
Test Case 4:
Enter your water usage in gallons: 6001
Money owed: $14.11
 Python Your local utility company charges customers for water usage on

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!