Good job! In summary, add the results of each loop to a String object and output the completed String object after exiting the loop.
Type: Posts; User: GregBrannon
Good job! In summary, add the results of each loop to a String object and output the completed String object after exiting the loop.
You could use an if statement to record the correct data based on the value of the for loop's control variable, but that's almost (not quite) as much trouble as repeating the same code 3 times.
Have you learned arrays yet? Maybe it doesn't matter.
Anytime you're repeating the exact same code, you should wonder, "How can I put this in a loop?" or "How can I write a method to do this?" ...