Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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:image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Pro PowerShell For Database Developers

Authors: Bryan P Cafferky

1st Edition

1484205413, 9781484205419

More Books

Students also viewed these Databases questions