Question: Please code is to be written in Java only Lab4D: Water company (Extra Credit +10pts) Imagine your water company bases their rates on how much

Please code is to be written in Java only

Lab4D: Water company (Extra Credit +10pts) Imagine your water company bases their rates on how much water your household uses. The more water you use, the higher your rate per gallon will be. If your household uses less than 1,000 gallons per month, you will be charged $0.15 per gallon. If your household uses more than 1,000 gallons, the water used beyond 1,000 gallons is charged at $0.25 per gallon up to 2,000 gallons. The water usage that exceeds 2,000 gallons is charged at $0.35. Write a program that prompts the user to input the amount of water used in a month (in gallons) and then calculates their water bill. For example, if the user inputs 1,200 gallons, 200 of those gallons will be at a rate of $0.25 and the remaining 1,000 will be at the rate of $0.15. A sample run is shown below. User input is in bold. Note: The logic can be tricky, but think of how you had to calculate overtime pay in Lab4B. Sample run #1: Gallons of water: 1000 Water bill is: $150.0 Sample run #2: Gallons of water: 1500 Water bill is: $275.0 Sample run #3: Gallons of water: 2750 Water bill is: $662.5

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!