Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

h 40000 t 37.81 height 40016.21 5) Bank 1 pays 6% annual interest, Bank 2 pays 4

ID: 3699019 • Letter: H

Question

h 40000 t 37.81 height 40016.21 5) Bank 1 pays 6% annual interest, Bank 2 pays 4.3% annual interest, and 2 Bank 3 pays 2% annual interest. A customer deposits $600 initially and $800 at the end of each year in al1 three banks. Write a MATLAB program to do the following: a) For each bank, calculate and print how many years it will take to accumulate at least $14, 000 and the exact balance in the account after that many years. Use a step size of 1 for years. b) calculate and print how much longer it wil1 take to accumulate $14,000 in Bank 2 compared to Bank 1, and how much longer it will take to accumulate at least $14, 000 in Bank 3 compared to Bank 1. The output of this program should look like this: Bank 1: Years-12 Balance $14703.27 Bank 2: Years-13 Balance $14592.62 Bank 3: Years-15 Balance $14642.25 Additional years needed in Bank 21 Additional years needed in Bank 3 3 htps:/www.courschero.com/ile/23647993 CSC1240-exam-2/ MacBook Air

Explanation / Answer


As per Chegg policy we are supposed to answer first complete question. So given code for Question 5. Request you to post other question separately.


r1 = 6;
r2 = 4.3;
r3 = 2;

p = 600;
final = 14000;
amt1 = p;
amt2 = p;
amt3 = p;

years1 = 0;
years2 = 0;
years3 = 0;


while amt1 < final
years1 = years1 + 1;
interest = amt1 * r1 / 100;%calculate interest
amt1 = amt1 + interest;%add interest
amt1 = amt1 + 800;%additional yearly investment
end

while amt2 < final
years2 = years2 + 1;
interest = amt2 * r2 / 100; %calculate interest
amt2 = amt2 + interest; %add interest
amt2 = amt2 + 800; %additional yearly investment

end


while amt3 < final
years3 = years3 + 1;
interest = amt3 * r3 / 100;%calculate interest
amt3 = amt3 + interest;%add interest
amt3 = amt3 + 800;%additional yearly investment

end


fprintf("Bank 1: Years = %d Balance = $%.2f ", years1, amt1);
fprintf("Bank 2: Years = %d Balance = $%.2f ", years2, amt2);
fprintf("Bank 3: Years = %d Balance = $%.2f ", years3, amt3);

fprintf("Additinal years needed in Bank 2 : %d ", years2 - years1);
fprintf("Additinal years needed in Bank 3 : %d ", years3 - years1);


===================
output
==================
Bank 1: Years = 12 Balance = $14703.27
Bank 2: Years = 13 Balance = $14592.62
Bank 3: Years = 15 Balance = $14642.25
Additinal years needed in Bank 2 : 1
Additinal years needed in Bank 3 : 3