셈툴 다운로드

셈툴 튜토리얼

공학수학 | 복리(compound interest) |

페이지 정보

작성자 cemtool 작성일14-06-16 16:37 조회8,409회 댓글0건

본문

복리가 매년 6%인 은행 계좌에 $1000를 예치하였다. 이후 5년 동안의 금액을 구하여라.

ex10_1.cem
/*
 Example 10.1 Compound interest problem
*/
 
// CEMTool solution of the compound interest equation
// y(nT)=y(nT-T) + (p/100)*y(nT-T)// for p = 6 percent and initial deposit y0 = $ 1000// y(n) represents the balance after the nth year
 
a=1.06;        // Calculation for 5 years at 6% interest 
y0 = 1000      // Initial deposit
 
for(n=1;n<=5;n++) 
    y(n) = a^(n)*y0;
 
msgprint("       1        2         3          4         5") 
y
 
 
따라서, 결과는 다음과 같다.
y(1) = (1.06)y(0) = 1060.0 y(2) = (1.06)y(1) = 1123.6 y(3) = (1.06)y(2) = 1191.0 y(4) = (1.06)y(3) = 1262.5 y(5) = (1.06)y(4) = 1338.2
댓글목록

등록된 댓글이 없습니다.