Question: a) Give one difference between while and for loop syntax. (2 marks) b) Compound interest can be calculated using the following formula: B =
a) Give one difference between while and for loop syntax. (2 marks) b) Compound interest can be calculated using the following formula: B = a(1+r)" where, a is the invested money; r is the interest rate; n is the total of years; and B is the final balance. Let r=8%. Using while loop, write a MATLAB code to calculate B for a = (100, 500,800) and n = {2,4,6,8,10). (8 marks)
Step by Step Solution
3.55 Rating (165 Votes )
There are 3 Steps involved in it
QUES... View full answer
Get step-by-step solutions from verified subject matter experts
