CSE 232 Spring 2012 Computer Project #3 -- C++ Control Structures Assignment Overview: This assignment focuses on the design, implementation and testing of C++ functions which use control structures. You will develop two functions which will complete the program described below. It is worth 30 points (3% of course grade), and must be completed no later than 11:59 PM on Thursday, February 2. Assignment Specifications: 1) The program will compute and display information for a utility company which supplies water to its customers. For a specified customer, the program will compute and display the amount of money which the customer will be charged for water usage during the current billing period. 2) The program will be composed of three functions: "main", "gallons", and "fee". The instructor will supply function "main"; you will supply the other two functions. 3) Function "main" will perform all input and output operations. It will call functions "gallons" and "fee" as needed to compute the desired output. Function "main" will repeatedly prompt the user to enter the billing code for a given customer, as well as the two meter readings for that customer. It will then process that customer's information and display the results. It will halt when the user enters "end-of-file" (control-d) instead of a billing code. 4) Function "gallons" will be declared as: double gallons( int, int ); where the first argument represents the beginning meter reading and the second argument represents the ending meter reading (assume that the meter is read by a representative of the utility company at the beginning and ending of the billing period). The readings are taken from a meter which has nine digits and records tenths of a gallon. Function "gallons" will return the number of gallons of water used by the customer during the current billing period. Note that the meter's dial has nine digits and records tenths of a gallon. For example, assuming that the beginning reading was 444400003 and the ending reading was 444400135, then the customer used 13.2 gallons of water during the billing period. Also, note that the reading at the end of the billing period may be less than the reading at the beginning of the billing period, since the meter's dial has only nine digits. For example, assuming that the beginning reading was 999999997 and the ending reading was 000000005, then the customer used 0.8 gallons of water during the billing period. 5) Function "fee" will be declared as: double fee( char, double ); where the first argument represents the billing code of the customer ('R', 'C' or 'I'), and the second argument represents the gallons of water used by the customer during the current billing period. Function "fee" will return the amount of money that the customer will be charged, based on the customer's billing code and water usage, using the following information. Code 'R' (residential): $5.00 plus $0.0005 per gallon used Code 'C' (commercial): $1000.00 for 4 million gallons or less, and $0.00025 for each additional gallon used Code 'I' (industrial): $1000.00 if usage does not exceed 4 million gallons; $2000.00 if usage exceeds 4 million gallons but does not exceed 10 million gallons; and $2000.00 plus $0.00025 for each additional gallon if usage exceeds 10 million gallons. Function "fee" will return a value of zero for an unrecognized billing code. Assignment Deliverables: The deliverables for this assignment are the following files: proj03.support.cpp -- the source code for your functions proj03.support.h -- the interface to your functions Be sure to use the specified file names, and to submit your files for grading via the "handin" system. Assignment Notes: 1) Please note that the final versions of your functions will not perform any input or output operations, although you may wish to display selected values while you are developing your functions. 2) The instructor will supply the following file: /user/cse232/Projects/project03.driver.o where "project03.driver.o" contains the object code for function "main". 3) Use the following command to compile and link the program: g++ proj03.support.cpp /user/cse232/Projects/project03.driver.o where "proj03.support.cpp" is the name of your source code file.