Uploaded by danielbenjaminwest

Project Version 1 Instructions

advertisement
PROGRAM DESCRIPTION
From: Stewart Dent, Software Lead
The WaterWorks Utilities Company
To: Interns
RE: Log files
Welcome to The WaterWorks summer intern program. You have been assigned to the
software development team as a programmer.
BACKGROUND:
At the end of each month, our technicians take readings from every residential water
meter in their service area. We want to keep each customer informed by providing a
quarterly report that summarizes that customer’s water consumption for the quarter.
REQUIREMENTS:
Write a program that displays a customer’s quarterly report. The program should request
the customer’s water usage and then display the quarterly report on the console.
• Request the following information:
Date the meter was read (mm, dd, yyyy)
The meter number (allow up to 8 digits)
Size of residence in square feet
Gallons used in 1st month
Gallons used in 2nd month
Gallons used in 3rd month
•
Then, display the quarterly report
▪ Display leading zeros, if there are any, in the meter number
▪ Display floating point numbers with a resolution of 2 decimal places
and align the decimal points.
▪ Use named constants wherever possible.
▪ Assume that the national average water consumption for a residence is
2.095 gallons per square foot of the residence size.
•
Use WW_Header.cpp (attached) as a starting point for your code. It contains the
WaterWorks approved file header, which must be included at the head of all
company source code files.
Examples follow:
Example #1 – where the AVERAGE IS WITHIN LIMITS of average household
consumption:
Enter
Enter
Enter
Enter
00.44
the date the meter was read (mm dd yyyy) 3 1 2019
the meter number (8 digits) 06974420
the size of residence in square feet 1895
the gallons used in each of 3 months (seperated by a space) 36
4497.23 3798.8
Quarterly report for meter number 06974420 for the period ending 3/1
/2019
Usage month #1:
Usage month #2:
Usage month #3:
Total usage:
Average usage:
3600.44
4497.23
3798.80
11896.47
3965.49
gallons
gallons
gallons
gallons
gallons per month
The average monthly household water consumption for a 1895.00 square
foot house is 3970.03 gallons.
Your average monthly consumption of 3965.49 gallons is 4.54 gallons
below the average.
Example #2 – where the average EXCEEDS AVERAGE household consumption:
Enter
Enter
Enter
Enter
97.92
the date the meter was read (mm dd yyyy) 3 2 201
the meter number (8 digits) 00042341
the size of residence in square feet 2024
the gallons used in each of 3 months (seperated by a space) 38
5204.99 4204.7
Quarterly report for meter number 00042341 for the period ending 3/2
/2019
Usage month #1:
Usage month #2:
Usage month #3:
Total usage:
Average usage:
3897.92
5204.99
4204.70
13307.61
4435.87
gallons
gallons
gallons
gallons
gallons per month *
The average monthly household water consumption for a 2024.00 squa
re foot house is 4240.28 gallons.
*Your average monthly consumption of 4435.87 gallons exceeds the av
erage by 195.59 gallons.
Download