title: Finding the future value and interest rate in JavaScript
body: <p>The problem I am having is with the last for loop that calculates the future value near the bottom. What I'm looking for is the modify it so that it displays the interest rate and value for each year. It should be displayed next to the year in this format: year=1 interest=750 value= 10750.</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var again = "y";
  var interest = []
  var year = []
  var value = []
  do {
    var futureValue
    var value = 0
    //get user entries
    do {
      var investment = prompt("Enter investment amount as xxxxx.xx", 10000);
      investment = parseInt(investment);
      if (isNaN(investment)) {
        alert("Investment must be a number");
      }
    }
    while (isNaN(investment));
  
    do {
      var rate = prompt("Enter interest rate as xx.x", 7.5);
      rate = parseFloat(rate);
      if (1 &gt; rate || 15 &lt; rate) {
        alert("Rate must be below 15 and above 0");
      }
    }
    while (1 &gt; rate || 15 &lt; rate);
    var years = prompt("Enter number of years", 10);
    years = parseInt(years);
  
    //calculate future value
    futureValue = investment;
    for (var i = 1; i &lt;= years; i++) {
      futureValue = futureValue + (futureValue * rate / 100);
      interest += (futureValue * rate / 100) + "\n";
      year += i;
      value = futureValue;
  
    }
    futureValue = parseInt(futureValue);
    again = prompt("Repeat Entries?", "y");
  }
  while (again == "y");</code></pre>
  </div>
  </div>
  </p>