I need help on a subtle problem in my java code. I writing a program for college admissions and I have all the computations figured out but I want to prompt the user to say
inforamtion for applicant #1:
<code>
information for applicant #2:
<code>
etc
the only thing changing is the number. I know i can loop it like this:
for (int i = 1; i <= 2; i++) {
System.out.println("Information for applicant #" + i + ":");
}
but that will run my computations in my code twice for each person. How can i have it where I'm not redundant but still be able to differentiate the number value?
inforamtion for applicant #1:
<code>
information for applicant #2:
<code>
etc
the only thing changing is the number. I know i can loop it like this:
for (int i = 1; i <= 2; i++) {
System.out.println("Information for applicant #" + i + ":");
}
but that will run my computations in my code twice for each person. How can i have it where I'm not redundant but still be able to differentiate the number value?