summaryrefslogtreecommitdiff
path: root/659/CH1/EX1.5/exm1_5.sce
blob: ea39cb686e63f0c643f66b8f3e32282c1873a023 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//            Example 1.5
// SAMPLE PROGRAM 3: INTEREST CALCULATION

PRINCIPAL=5000.00;
PERIOD=10;
//Assignment Statements
amount=PRINCIPAL;
inrate=0.11;
year=0;
//Computation using while loop
while(year<=PERIOD)
    printf("%2d %8.2f\n",year,amount);
    value=amount+inrate*amount;
    year=year+1;
    amount=value;
end //End of while loop