Question: Write a C program that computes a customers water bill. The bill includes a $30.00 flat charge plus a usage charge of $0.55 for every

Write a C program that computes a customers water bill. The bill includes a $30.00 flat charge plus a usage charge of $0.55 for every thousand liters or part thereof. Also, to discourage overuse (daily car washes etc.), a penalty is added to the bill depending on the amount of water used. Use the following table to determine the percentage penalty for customers usage level: Write a C program that computes a customers water bill. The

The program should read in a customer number (5 digits use long int), the current water meter level, and the previous water meter level (floats), and then compute the total water consumed and the amount owed. The program should then output (in a neat manner), customer number, the amount of water used, and the amount of the bill.

For example, if the input was: 12345 80000 20000

then the water usage for Customer 12345 is 60000 litres,

thus the Amount owing for Customer 12345 would be

= $30.00 + (60000/1000 * $0.55) + $12.60

= $75.60

note: ($30 + ($33)) * 20% = $12.60

Your program should be general enough to work with any customer information but it only has to process 1 customer at a time (i.e. dont need to use loops).

Total Usage (litres Calculate as a Percentage of Total Bill 25,000 0% 50,000 10% 75,000 20% 100,000 30% 100,000 60%

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!