“Know how to solve every problem that has been solved.” “What I cannot create, I do not understand.” — Richard Feynman

Simple Interest

Programming

Simple interest is the one-line deal: the bank pays you the same fixed slice of your principal every year. The formula is nothing but multiplication —

Interest = Principal × Rate × Time / 100

Implementation

program simple_interest
    implicit none
    integer, parameter :: dp = kind(1.0d0)
    real(dp) :: principal, rate, time, interest

    print *, "Enter principal amount:"
    read *, principal
    print *, "Enter annual interest rate (in percentage):"
    read *, rate
    print *, "Enter time (in years):"
    read *, time

    interest = principal * rate * time / 100.0_dp
    print *, "Simple Interest: ", interest
end program simple_interest

Example Interaction

Enter principal amount:
1000
Enter annual interest rate (in percentage):
5
Enter time (in years):
2
Simple Interest:    100.00000000000000

The interesting part: what simple interest refuses to do

Simple interest never pays interest on interest — the yearly payment is computed from the original principal forever, so the balance grows along a straight line. Compound interest folds each payment back into the principal, and the line bends into an exponential. The gap starts invisible and ends absurd. From an actual run (both formulas, $1000 at 5%):

program interest_compare
    implicit none
    integer, parameter :: dp = kind(1.0d0)
    real(dp) :: p, r, simple, comp
    integer :: t, n
    p = 1000.0_dp; r = 0.05_dp
    print '(a)', " years   simple      compound"
    do t = 0, 30, 5
        simple = p * (1.0_dp + r * t)        ! straight line
        comp   = p * (1.0_dp + r) ** t       ! exponential
        print '(i5, 2f12.2)', t, simple, comp
    end do
end program
 years   simple      compound
    0     1000.00     1000.00
    5     1250.00     1276.28
   10     1500.00     1628.89
   15     1750.00     2078.93
   20     2000.00     2653.30
   25     2250.00     3386.35
   30     2500.00     4321.94

Thirty years in, simple interest has earned $1,500 and compounding has earned $3,322 — more than double, from the same rate. A handy compression of the exponential: money at r% doubles in roughly 72/r years (the "rule of 72"; at 5% that predicts 14.4 years, and the exact answer ln 2 / ln 1.05 = 14.2 agrees).

One more turn of the crank: compound more often than yearly and the balance climbs toward a ceiling. Splitting 5% into n payments of 5/n percent, one year on $1000 gives:

     1 x/yr   1050.000000
    10 x/yr   1051.140132
   100 x/yr   1051.257960
  1000 x/yr   1051.269782
 10000 x/yr   1051.270965
 e^r  limit   1051.271096

The ceiling is — compounding continuously turns the interest formula into the exponential function itself. That is the arc: multiplication (this page's program), a geometric series (yearly compounding), and in the limit, . Not bad for a program that started as P * r * t / 100.