rks2_2 - %case 2 with k = 20 yrs and 7.5% clear k; clear i;...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
%Engineering 6, Winter 2006, Problem 2.2 %Raminderdeep Sidhu, 7987 %section A01, Thursday 8- 8:50 %This program calculate the amount of the money an investment yeids given %by the following eqaution: amount = M(1 + (i/100))^k %compute and display the result in case 1 with k = 20 yrs. format bank; clc; M = 5000; %initial investment in dollars in year 0 i = .05; %compunded anually interest rate k = 20; %amount of money in year k amount1 = M * ( 1 + i/100)^k; %compute the invested money fprintf('The amount of money ($) in 20 years at 5 percent:', amount1) disp(amount1) %case 1 with k = 40 yrs. clear k; %delete the value of k k = 40; amount2 = M * (( 1 + i/100)^k); fprintf('The amount of money ($) in 40 years at 5 percent:', amount2) disp(amount2)
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: %case 2 with k = 20 yrs and 7.5% clear k; clear i; %delete the value of i i = .075; k = 20; amount3 = M * ( 1 + i/100) ^k; fprintf('The amount of money ($) in 20 years at 7.5 percent:', amount3) disp(amount3) %case 2 with k = 40 yrs clear k; k = 40; amount4 = M * ( 1 + i/100) ^k; fprintf('The amount of money ($) in 20 years at 7.5 percent:', amount4) disp(amount4) %case 3 with k = 20 yrs and 10 percent clear i; clear k; i = .1; k = 20; amount5 = M * ( 1 + i/100) ^k; fprintf('The amount of money ($) in 20 years at 10 percent:', amount5) disp(amount5) clear k; k = 40; amount6 = M * ( 1 + i/100) ^k; fprintf('The amount of money ($) in 40 years at 10 percent:', amount6) disp(amount6) fprintf('\n\n\n');...
View Full Document

Ask a homework question - tutors are online