Compound Interest

Objective

To implement a program that calculates compound interest. 

 

Theory

Compound interest is the addition of interest to the principal sum of a loan or deposit, or in other words, interest on principal plus interest. Unlike simple interest, which is calculated only on the initial amount, compound interest takes into account the interest that accumulates over time. It is the result of reinvesting interest, rather than paying it out, so that interest in the next period is then earned on the principal sum plus previously accumulated interest.   

The compound interest is calculated using the formula:  

For an initial principal of P, rate of interest per annum of r (r%), time period t in years, frequency of the number of times the interest is compounded annually n, the formula to calculate the total compounded amount is as follows: 

                                    A = P (1 + r/n)nt 

If compound interest calculate once in a year, then  

                           A = P (1 + r)t 

For example, If Rs. 5000 is invested in a bank where the amount is compounded continuously at a rate of 7% per year, then the resultant amount after 3 years will be Rs.6125.21 

 

Learning Outcomes

  • Understand the concept of compound interest and its implications in everyday financial scenarios. 
  • Learn how interest compounds over time and affects the total amount of money saved or borrowed. 
  • Apply mathematical formulas in a real-world context, specifically the compound interest formula, to solve everyday financial problems. 
  • Gain familiarity with basic programming constructs, such as loop (‘for’), and understand how they can be used to model repetitive financial calculations.