MATLAB QUESTION:
You want to invest $10,000 until your balance is at least $15,000. You have a choice between two banks to invest in. Bank A offers 13% interest, compouned yearly. Bank B offers 1% interest compouned monthly. Compouned yearly means the interest is calculated and deposited in the account just once per year, as opposed to monthly which is done 12 times per year.
Write a single script file for parts a and b.
A. Use separate while loops to calculate the balance of your investment in both banks. Keep track of the years/months it takes to reach the goal of $15000.
B. Use if statements to determine which bank is the better investment choice. The output of your script should be formatted as follows filling the blanks with the correct values. Dollar amounts should be precise to 2 decimal places:
Format:
Bank __ is the better choice.
Balance is $___._ after __ months.
(Please explain code a little)
Fromula for compound interest is A = P (1+r)n
Bank A: | Bank B: |
Amount = 15,000 Principal = 10,000 Rate = 13% or 0.13 15000=10000(1+0.13)n 15000/10000=1.13n log(15000/10000)=nlog1.13 n=log(1.5)/log(1.13) n= 0.405/0.1222 n = 3.314 Time is 3.314 years |
Amount = 15,000 Principal = 10,000 Rate = 1%, compounded monthly 15000=10000(1+0.01)n 15000/10000=1.01n log(15000/10000)=nlog1.01 n=log(1.5)/log(1.01) n= 0.405/0.00995 n = 40.704 n = frequency*time 40.704=12*time Time = 40.704/12 Time = 3.392 years |
Bank A is better choice as we can generate required amount in 3.314 years
Balance is $15,000 in 3.314 years
Get Answers For Free
Most questions answered within 1 hours.