Write a C program that will calculate and print out the bills for 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
• Code h: RM5.00 plus RM0.0005 per gallon used
• Code c: RM1000.00 for the first 4 million gallons used and RM0.00025 for each additional gallon
• Code i: RM1000.00 if usage does not exceed 4 million gallons; RM2000.00 if usage is more than 4 million gallons but does not exceed 10 million gallons; and RM3000.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 double). Your program should echo the input data and print the amount due from the user.
1
Expert's answer
2012-09-27T10:52:46-0400
#include <iostream> #include <cmath> #include <conio.h> using namespace std;
int main() { int account; char code; double gallons, bill;
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
Finding a professional expert in "partial differential equations" in the advanced level is difficult.
You can find this expert in "Assignmentexpert.com" with confidence.
Exceptional experts! I appreciate your help. God bless you!
Comments
Your program is helpful
Dear Guy, You're welcome. We are glad to be helpful. If you liked our service please press like-button beside answer field. Thank you!
thank you, kind sir
Leave a comment