Program3 - COSC1415/COSC1436 OnLine Programming Assignment...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
COSC1415/COSC1436 OnLine Programming Assignment 3 Page 1 of 2 Name Chintu Patel 8001 C++ Programming Assignment #3 TOPIC: Conditions/Logical Expressions/Value-Returning Functions VALUE: 10 points DATE DUE: Monday, March 24 Program Statement Write a program that will calculate and print bills for Dallas Water Utilities. Water and sewer rates vary, depending on the size of the meter and water usage. Any meter size other than what is listed should be treated as an error. In addition a Sanitation Fee of $20.41 and a Storm Water Fee of $5.80 are added to the bill. The water rates are computed based on the tables below and come from the following website. http://www.dallascityhall.com/html/water_billing_rates.html Meter Size Base Water Charge Base Sewer Charge 0.625 3.61 3.23 0.75 4.23 3.78 1.0 6.14 5.49 Residential Water per Gallon Sewer per Gallon Up to 4000 gallons 0.00141 0.00372 4001 to 10000 0.00231 0.00372 10001 to 15000 0.00320 0.00372 Above 15000 0.00370 0.00372 Your program should prompt the user to enter the account number (a string), the meter size and the number of gallons of water used. Your program should print the account number, the number of gallons used, the total water charge, the total sewer charge, and the total amount of the bill. (Don’t forget to include the Sanitation Fee and the Storm Water Fee.) Program Specifics: 1. Include a comment after each #include directive indicating what each header file is used for 2. Declare the Sanitation Fee and the Storm Water Fee as constants. You may declare other appropriate values as constants. Declare your constants before int main( ) 3. Include a comment after each variable declaration. 4. Follow C++ conventions for naming constants, variables and functions. 5. Put a comment indicating the declaration section, input section, processing section and output section of your program. Separate the sections with a blank line. 6. If the meter size is not valid (not listed in the table), then an error message should be printed and processing should stop.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
COSC1415/COSC1436 OnLine Programming Assignment 3 Page 2 of 2 7. Use at least three value-returning functions in your program. 8. Use value-returning functions for all calculations. No calculations should appear inside the main function. 9. Print the account number, the number of gallons of water used, the total water charge, the total sewer charge, and the total amount of the bill from the main function. (Nothing should be printed from a value-returning function. 10. Include preconditions and postconditions for each function. Write the preconditions and postconditions between the function heading and the function body. 11. The output data should be properly labelled. 12.
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 05/06/2008 for the course COSC 1436 taught by Professor May during the Spring '08 term at Dallas Colleges.

Page1 / 7

Program3 - COSC1415/COSC1436 OnLine Programming Assignment...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online