Subgoals for Writing a Loop
Determine purpose of loop
Pick a loop structure (while, for, do_while)
Define and initialize variables
Determine termination condition
Invert termination condition to continuation condition
Write the loop body
Update Loop Control Variable to reach termination
Put the code in the right order to create a program that will calculate and print the sum of 10 natural numbers.
Put the code in the right order to create a program that will generate an integer between 0 and 10,000 (inclusive), print the number, calculate and print the number of digits in the number.
Put the code in the right order to create a program that will print out all Armstrong numbers between 1 and 500. If the sum of the cubes of each digit of the number is equal to the number itself, then the number is called an Armstrong number. For example, 153 = (1*1*1) + (5*5*5) + (3*3*3)