Question: I need to write a c++ program that will do the following: Inputs: (1) (from keyboard) File name: if the name is NONE, read data
I need to write a c++ program that will do the following:
Inputs:
(1) (from keyboard) File name: if the name is "NONE", read
data from keyboard. Otherwise, open the input file and
read data from the file.
(2) (from file OR keyboard) INPUT for a one utility customer,
in the format (one space before customer name):
format: PreviousReading CurrentReading CustomerName
sample: 04304450 04305150 Sam R. Jones
NOTES:
[1] Meter readings are 8-digit integers.
[2] Utility charges can be up to $9,999.99
[3] Customer name is a string that can contain spaces.
[4] When the end_reading < start_reading, program must:
a) output message:
BAD METER READINGS: xxxxxxxx (START) xxxxxxx (END)
b) do not attempt to calculate charges, but still
print the statement, including the following lines
for charges due and power usage.
CHARGES DUE: $DEFERRED
POWER USAGE: ????? KWH
Computation: Utility charges are based on the following scale:
Power (KWH)Used Utility Charge Formula
---------------- -------------------------------
0 - 500 $53.00 + 0.165 x KWH
501 - 1000 $75.50 + 0.125 x KWH
1001 - 3000 $125.75 + 0.117 x KWH
above 3000 $400.07 + 0.017 x KWH
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
