Learning objectives
Write while and for loops for a known and for an unknown number of repetitions, and convert a for loop into an equivalent while loop
Trace a loop by hand, recording the loop control variable and any accumulator on every iteration, and state exactly how many times the body runs
Identify the cause of an infinite loop or an off-by-one error and correct it, and explain how a return statement inside a loop ends the method at once
Write the standard numeric loop algorithms: a sum or average, a minimum or maximum, a divisibility test with %, the extraction of each digit of an int with % 10 and / 10, and a count of how often a condition holds
Write String algorithms that step through a String with length and substring to test whether some substring has a property, to count the substrings meeting a criterion and to build the String in reverse
Continue with a revision plan
These learning objectives are available to everyone. Sign in with an eligible plan to read the full note and worked examples.
