Answer to Question #4746 in C++ for zuwaira m

Question #4746
Write a C++ program that calculates and prints out bills of the city water company. The water rates vary, depending on whether the bill 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. Any other code should be treated as an error. The water rates are computed as follows:
• Code h: Dh 5.00 fees with each bill plus Dh 0.005 per gallon use
• Code c: Dh 1000.00 if the number of gallons used is 4 million or less and Dh 0.0025 for each additional gallon
• Code i: Dh 1000.00 if usage is 4 million gallons or less; Dh 2000.00 if usage is more than 4 million gallons but doesn’t exceed 10 million gallons; and Dh 3000.00 if usage exceeds 10 million gallons.
Your program should prompt the user to enter an account number (type int), the code (type char), and the gallons of water used (type float). Your program should print the input data and print the amount due. Use switch statement when appropriate.
0
Expert's answer

Answer in progress...

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS