Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a program that will calculate and print out bills for the city water company. The water rates vary depending on whether the water is
Write a program that will calculate and print out bills for the city water company. The water rates vary depending on whether the water is for home use, commercial use or industrial use. A code of H/h means home use, a code of C/c means commercial use and a code of I/i means industrial use. The water rates are computed as follows: code H/h: P250.00 plus P0.002 per gallon used code C/c: P5,000.00 for the first 4 million gallons and P0.002 for each additional gallon. code I/i: P8,000 if usage does not exceed 4 million gallons, P14,000 if usage is more than 4 million gallons but not more that 10 million gallons and P18000 if usage exceeds 10 million gallons. Your program should prompt the user for the code and the gallons of water used. Your program should echo your input data and should print the amount due from the user. Your program should use a switch statement for the code (char data type). Use the float data type for the gallons. Write a program that will calculate and print out bills for the city water company. The water rates vary depending on whether the water is for home use, commercial use or industrial use. A code of H/h means home use, a code of C/c means commercial use and a code of I/i means industrial use. The water rates are computed as follows: code H/h: P250.00 plus P0.002 per gallon used code C/c: P5,000.00 for the first 4 million gallons and P0.002 for each additional gallon. code I/i: P8,000 if usage does not exceed 4 million gallons, P14,000 if usage is more than 4 million gallons but not more that 10 million gallons and P18000 if usage exceeds 10 million gallons. Your program should prompt the user for the code and the gallons of water used. Your program should echo your input data and should print the amount due from the user. Your program should use a switch statement for the code (char data type). Use the float data type for the gallons
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started