Please help issue with a variable in a loop.
In the following code the for loop variable rate learns its value from an if then statement based on the input of the user. I need to modify it within the loop to use the value of the input plus the loop counter. Any help would be appreciated. Here is the section of code in question.
if(annual + loopcounter>=(.80 * target) && annual + loopcounter <= target)
looprate = .05;
else if(annual + looprate>= target)
looprate = .05 + .125;
for(loopcounter = 5000; (loopcounter + annual) < annual * 1.5;
// Output for table
System.out.println((annual+loopcounter) + " \t " +
((annual+loopcounter) * looprate + salary));
looprate is only being based on the initial input of annual and not of annual+loopcounter.
Re: Please help issue with a variable in a loop.
Don't double post. Return to the first post and continue working it there.