Question
Water consumption charges The following charts explain how a water supply company charges its single-family residential customers. The base charge is the minimum monthly service
Water consumption charges
The following charts explain how a water supply company charges its single-family residential customers. The base charge is the minimum monthly service charge per meter per month. The AWC (average winter consumption) is the average amount of water used between September and February. This value will differ between customers and are updated every March. The rate changes depending on the amount of water used with respect to the AWC and time of year. Write a function M-file named WaterCharge to compute the total amount to be billed to the customer. The input arguments are the meter size, AWC, kgal usage and the month (1-12). The output argument is the billed amount for that month.
Meter Size | Charge |
0.75 inch | $16.00 |
1 inch | $26.71 |
1.5 inch $ | $53.26 |
Cost per kgal (March to Aug) | Cost per kgal (Sep to Feb) | |
0-AWC | $4.65 per kgal | $4.65 per kgal |
AWC-(AWC+40) | $7.2 for each kgal over AWC | $6.45 per kgal over AWC |
Over (AWC+40) | $6.94 for each kgal >AWC+40 | $6.14 per kgal > AWC+40 |
Example
>> WaterCharge(1,4,86,6)
ans = 624.7900
Input Restrictions:
The function should halt and return a red error message if the following conditions are not met: The input meter size must be a scalar and only one of the values: 0.75, 1 and 1.5 AWC must be a positive scalar Array input is allowed for kgal and month, but the arrays must be the same length Input kgal must be positive; kgal may be = 0. The month must be a integer between 1 and 12
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started