Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.

Base charges
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

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

DB2 Universal Database V7.1 Application Development Certification Guide

Authors: Steve Sanyal, David Martineau, Kevin Gashyna, Michael Kyprianou

1st Edition

0130913677, 978-0130913678

More Books

Students also viewed these Databases questions

Question

=+ 5. Do Europeans work more or fewer hours than Americans?

Answered: 1 week ago