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)

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

1 Expert Approved Answer
Step: 1 Unlock

QUES... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!