14.3. Save Your Money

For this assignment, we will practice writing a while loop with a selection construct.

Since you will be well paid after graduating from college, let’s say that you invest $1,000 at the beginning of each month. At the end of each month, you are paid interest on your investment. The interest rate paid depends on the account balance. The annual rate is

\spalignsys{0 < balance \leq 10{,}000: 1 \%;
10{,}000 < balance \leq 15{,}000: 2 \%;
15{,}000 < balance \leq 30{,}000: 3 \%;
30{,}000 < balance \leq 100{,}000: 5 \%;
100{,}000 < balance \.: 7 \%}

Note that these are annual interest rates, not monthly rates. Write a program that tracks the balance of the savings until it is at least 1 million dollars.

Complete the assignment using MATLAB Grader.

Save Your Money - MATLAB Grader.