header

Homework 17

Modify the program you wrote for Lab 8 by adding a void function that uses the insertion sort algorithm to sort the array of investment records by present value. Invoke this function before writing the data to the output file. The resulting report should list the records sorted by present value in ascending order:

   Present  Nominal  Compounding              Future       Total
     Value     Rate  Frequency     Years       Value    Interest      APY
----------  -------  ------------  -----  ----------  ----------  -------
    500.00    6.90%  Monthly           3      614.63      114.63   7.122%
   1000.00    5.25%  Quarterly        10     1684.70      684.70   5.354%
   1000.00    5.25%  Annually         10     1668.10      668.10   5.250%
   1000.00    5.25%  Semiannually      5     1295.78      295.78   5.319%
   1000.00    5.25%  Monthly          10     1688.52      688.52   5.378%
   1500.00    4.00%  Quarterly         5     1830.29      330.29   4.060%
   2500.00    3.93%  Monthly           8     3421.84      921.84   4.002%