5.5.1. Loops-WE5-P1ΒΆ

Subgoals for Evaluating a Loop

  1. Diagram which statements go together.

  2. Define and initialize variables

    1. Determine the start condition.

    2. Determine the update condition.

    3. Determine the termination condition.

    4. Determine body that is repeated.

  3. Trace the loop.

    1. For every iteration of the loop, write down the values.


Put the code in the right order to create a program that will prompt a user to enter an integer which is NOT a negative mulitple of 5. If the user enters a negative multiple of 5, the program should ask for another value.

You have attempted of activities on this page