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 means home use, a code of c means commercial use and a code of I means industrial use. The water rates are computed as follows: code H: P250.00 plus P0.002 per gallon used code c: P5,000.00 for the first 4 million gallons and P0.002 for each additional gallon. code 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. method: c program, conditionals
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 means home use, a code of c means commercial use and a code of I means industrial use. The water rates are computed as follows:
code H: P250.00 plus P0.002 per gallon used
code c: P5,000.00 for the first 4 million gallons
and P0.002 for each additional gallon.
code 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.
method: c program, conditionals
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 3 images