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

Matlab question: Part 2: A Tale of Two Banks (12 points) Two banks are competing

ID: 3812054 • Letter: M

Question

Matlab question:


Part 2: A Tale of Two Banks (12 points)
Two banks are competing for customers on the basis of their respective services, locations and
community involvement. However, Bank A pays 3% simple annual interest and Bank B pays
3.5% simple annual interest. Joe Smith is trying to decide which bank is better for him, and
favors Bank A for its services, even though they pay less interest than Bank B. However, he
wants to know how much less money he would have at the end of five years if he chose Bank A
over Bank B.
Help Joe to make this decision by writing a MATLAB program to calculate how much less
money he would have after 5 years at Bank A than he would at Bank B. Assume that he would
open an account at either bank with $500 and would also deposit an additional $500 at the end of
each year. Use fprintf output statements to indicate your answer clearly.
Please submit the following to Canvas by 7:45 AM on the morning of Class 11B:
1. MATLAB script (.m) files for Parts 1 and 2.
2. One pdf containing screen shots of a test run in the command window.

Thank you!

Explanation / Answer

Amount=AmountA=AmountB=500

n=input("Enter how the years till which u want to see");

for i=1:n

Instrt_BankA=AmountA*1*(0.3);%Pricple*time*intrst

Instrt_BankB=AmountB*1*(0.35);

fprintf('The interest amount at Bank A at the end of year %d is %d ',i,Instrt_BankA);

fprintf('The interest amount at Bank B at the end of year %d is %d ',i,Instrt_BankB);

fprintf('After adding %d at end of each year .The new principle amount for the year %d will be ',Amount,(i+1));

AmountA=(i+1)*Amount+Instrt_BankA

AmountB=(i+1)*Amount+Instrt_BankB

end

fprintf('The difference in amount for %d years is %d ',n,(AmountB-AmountA));