please hepl me for final project section in:
http://ist.marshall.edu/cpp/projects.html
The final project contains two parts. In the first part you should complete the TTime class by defining the following operators:
<< - to be able to print the value of the object to any output stream (similar to the Print() method);
>> - to be able to read the value from any input stream (similar to the Read() method);
- (minus operator) - to be able to compute the difference in minutes between two time moments (should work similar to the Subtract() method, except that this should be a friend operator);
<, >, ==, <=, and >= to compare objects of the TTime type.
In the second part of the project you should write a test program that will use the new classes. Using previously created classes TTime and TMoney write a program to work with phone bills. This program should prompt the user for a file name, read data from the file, and print the bill. The data file should contain information on the following format:
123-4567 3:25pm 3:47pm
234-5678 6:37pm 7:00pm
345-5676 10:59pm 12:10am
Each line contains:
a phone number,
start time of the call,
and the time when the call was over.
The program should print the phone bill in the format:
Phone STime Minutes Price
123-4567 3:25pm 22 $3.30
234-5678 6:37pm 23 $3.45
345-5676 10:59pm 71 $7.10
--------------------------------
Subtotal: $14.85
Tax (5%): $0.74
Total: $15.59
Where
STime is the start time of the call,
Minutes is the long of the call in minutes,
Price is the price of the call, which is computed by multiplying the price of one minute by the call length. A minute price is $0.15 if the call starts between 8:00am and 7:00pm, and it's $0.10 otherwise.
Subtotal is the sum of all call prices.
Tax is just 5 percent of the Subtotal.
Total is the sum of the Subtotal and the Tax.
Note that you do not know how many lines the input file contains. Your program should read up to the very end of the file. If the file format is incorrect (for example, you cannot read the time correctly) your program should print an error message and terminate. You also should use all the properties of the classes you have written. For example, to read one line from the file you can use:
char phone[15];
TTime start, finish;
TMoney minute_price(0,10), call_price;
inp>>phone;
inp>>start>>finish;
call_price = minute_price * (finish-start);
(where inp is an input stream type object). We can use the code like the one in the last line because we redefined the minus operator for the TTime class and multiplication operator for the TMoney class.