Preview File Edit View Go Tools Window Help 8 H Fri 838 AM a

Preview File Edit View Go Tools Window Help 8% H. Fri 8:38 AM a Shorl Lab 8.pdf (page 1 of 2) Q Search Shorl Lab 8.pdf Problem 1) Use a for loop to determine the sum of the first 10 terms in the series 3k2, k In other words, calculate y for the following sum 1,2, ,10 12 y= 3k2 Note: Explicitly display y. Problem 2) Use a while loop to determine how many terms in the series 3k2, k = 1,2, are needed for the sum of the terms to exceed 1000. In other words, determine the smallest value of N, for the following sum, such that y-1000 y= 3k2 Note: Explicitly display N. Problem 3) Suppose a couple wants to start a college saving for their new born child. Their plan is to deposit $2500 as the start and contribute $200 monthly to the child\'s college saving account. Suppose also that the interest rate is 6% per year compounded monthly, which is equivalent to 0.5% each month.

Solution

Problem 1:

i = 1 ;
y = 0 ;
k=1 ;
for i=1:12
for k=1:10
y = y + (3*(k^2));
y
end
end
disp (\' Sum = \' );
y

Problem 2:

i = 1 ;
y = 0 ;
k=1 ;
N=200; % Enter some large value of N
count = 0;
for i=1:N
for k=1:N
y = y + (3*(k^2));
while ( y <= 1000)
count = count + 1
break
end
end
end
count

 Preview File Edit View Go Tools Window Help 8% H. Fri 8:38 AM a Shorl Lab 8.pdf (page 1 of 2) Q Search Shorl Lab 8.pdf Problem 1) Use a for loop to determine t

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site