Question: Write a program in Java that calculates the monthly water bill for a household based on their water usage in gallons. The program should: Ask
Write a program in Java that calculates the monthly water bill for a household based on their water usage in gallons. The program should:
Ask the user to enter the number of gallons of water used in the month.
Calculate the bill based on the following rates:
For usage up to gallons: $ per gallon.
For usage above gallons: $ per gallon for the excess usage over gallons
Display the total bill.
If the total bill is above $ display the message "High Usage" in addition to the bill. Otherwise, display "Normal Usage."
Example InputOutput:
Input: Gallons used:
Output: Total bill: $ High Usage
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
