Question: Assignment writingc++program You are given an input file rates.txt with the following sample data: NewYork Delhi 1.99 2.00 0.45 NewYork London 1.50 1.75 0.35 Chicago

 Assignment writingc++program You are given an input file rates.txt with the

Assignment writingc++program You are given an input file rates.txt with the following sample data: NewYork Delhi 1.99 2.00 0.45 NewYork London 1.50 1.75 0.35 Chicago Bombay 1.99 2.00 0.45 Chicago Bangkok 1.75 1.95 040 Each input line consists of the city from where the call is placed, the city to which the call is placed, the connection fee, amount for the first three minutes, and the amount for every additional minute after the first three minutes. Write a program that calculates the amount for a call placed for 15 minutes, 30 minutes, 45 minutes, and 1 hour (60 minutes), and stores it in an output file called a05output.txt. Format the output to two decimal places. Requirements: You must use the function prototypes given below. If input file or output file does not open, output an error message and exit the bool openinputFile(ifstream&, string filenamej; bool openOutputFile(ofstream &, string filenamel; void calculatelifstream &, ofstream &): You can add more functions if you like. Design Considerations Please use a while loop to read all lines of text from input file. Keep the input file in the same directory as your project. Sample of your output file: Sample of your Output file City from City to 15mins 30 mins 45 mins 60 mins New York Delhi 9.39 1614 2289 29.64 NewYork London 7.45 Chicago Bombay 9.39 Chicago Bangkok 8.50 22.89 17.95 22.89 20.50 NewYork Delhi 12.70 16.14 14.50 23.20 29.64 26.50 Design Considerations Please use a while loop to read all lines of text from input file. Keep the input file in the same directory as your project

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!