IT212 Midterm Lab Exam

IT212 Midterm  Lab Exam.
Read in three values representing respectively
a capital sum (integer number of pence),
a rate of interest in percent (float),
and a number of years (integer).
Compute the values of the capital sum with compound interest added over the given period of years. Each year's interest is calculated as
interest = capital * interest_rate / 100;
and is added to the capital sum by
capital += interest;
Print out money values as pounds (pence / 100.0) accurate to two decimal places.
Print out a floating value for the value with compound interest for each year up to the end of the period.
Print output year by year in a form such as: 

Original sum 30000.00 at  12.5 percent for 20 years

Year Interest  Sum
----+-------+--------
  1  3750.00 33750.00
  2  4218.75 37968.75
  3  4746.09 42714.84
  4  5339.35 48054.19
  5  6006.77 54060.96
  6  6757.62 60818.58
  7  7602.32 68420.90
  8  8552.61 76973.51
  9  9621.68 86595.19
 10 10824.39 97419.58

Post a Comment

0 Comments