CS 150 - Intro to Programming - Fall 2001


Programming Project 4 - 15 points

Due: Thursday, November1 by 2:30pm

Write a C++ program that reads loan data from a file and prints a report that compares the cost of a 30 year loan to the cost of a 15 year loan. See sample dialog / output below.(note output sent to screen and file). User input in bold.

Enter input file name:  loan.dat
Enter output file name: output.txt
 idNum      amount     rate       15 years              30 years
----------------------------------------------------------------------
 123456  100000.00     6.50    871.11   156799.33    632.07   227544.49
 123456  100000.00     7.00    898.83   161789.09    665.30   239508.90
 123456  100000.00     7.50    927.01   166862.22    699.21   251717.22
 654566  670000.00     6.00   5653.84  1017691.33   4016.99  1446115.87
 654566  670000.00     7.00   6022.15  1083986.89   4457.53  1604709.62
 987345  309666.00     7.50   2870.64   516715.58   2165.23   779482.66
 123987  132000.00     8.00   1261.46   227062.94    968.57   348684.93
 256389  555332.00     6.50   4837.54   870756.83   3510.08  1263627.36

//***********************  Sample loan.dat file  ***********************
123456 100000 6.50
123456 100000 7.00
123456 100000 7.50
654566 670000 6.0
654566 670000 7.0
987345 309666 7.50
123987 132000 8.00
256389 555332 6.5
//output file should look like screen output


NOTES

What to turn in:

Paper copies to be turned in:

yourLastNameP4.cpp

Files to be Turned In to the drop box by the due date shown above:

yourLastNameP4.cpp