title: For loop, integer value is not updating
body: <p>The value for salary is not updating in the <code>for</code> loop. If I enter the salary is 17000, then % for the first year is 5% I get the output of 17850 which is correct. Then loop goes back again and I input for example 5% again, I get output of 17850 again. I expected it to add another 5% to get 18742.5.</p>
  
  <pre><code>int n = Integer.parseInt(JOptionPane.showInputDialog("Please enter the amount of employees"));    
  int yr = Integer.parseInt(JOptionPane.showInputDialog("Please enter the amount of years"));
  
  for (int i = 1; i &lt;=n; i ++) {
     double salary = Double.parseDouble(JOptionPane.showInputDialog("Please enter the salary for employee "+i));
     for (int y = 1; y &lt;= yr; y++) {
        double percentage = Double.parseDouble(JOptionPane.showInputDialog("Please enter the percentage for year " +y));
        double perc =(salary * percentage / 100);
        double ann = perc + salary;
        JOptionPane.showMessageDialog(null, "Annual salary for employee " +i +" for the year " +y +" is €"+ann);
     } 
  }
  </code></pre>