Skip to main content

Section 5.10 Loops-WE5-P1

Subsection 5.10.1 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.

Subsection 5.10.2 Loops-WE5-P1

Exercises Exercises

1.

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.