0
0
Intro to Computingfundamentals~10 mins

Loops (repeating actions) in Intro to Computing - Draw & Build Visually

Choose your learning style9 modes available
Draw This - beginner

Draw a flowchart that repeats the action of printing numbers from 1 to 5 using a loop.

7 minutes
Hint 1
Hint 2
Hint 3
Grading Criteria
Start and End symbols present
Initialization of loop variable shown
Decision diamond correctly checks loop condition
Loop body includes print and increment steps
Flow returns to decision after increment
Loop ends when condition is false
Solution
  +---------------------+
  |       Start         |
  +----------+----------+
             |
             v
  +---------------------+
  | Set number = 1      |
  +----------+----------+
             |
             v
  +---------------------+
  | Is number <= 5?     |<----------------+
  +----------+----------+                 |
             | Yes                        |
             v                            |
  +---------------------+                |
  | Print number        |                |
  +----------+----------+                |
             |                           |
             v                           |
  +---------------------+                |
  | number = number + 1 |                |
  +----------+----------+                |
             |                           |
             +---------------------------+
             |
             v
  +---------------------+
  |        End          |
  +---------------------+

This flowchart starts by setting a variable number to 1.

It then checks if number is less than or equal to 5.

If yes, it prints the current number, then adds 1 to number.

The flow returns to the decision to check the condition again.

When number becomes 6, the condition fails and the flowchart ends.

This repeats the print action 5 times, printing numbers 1 through 5.

Variations - 2 Challenges
[intermediate] Draw a flowchart that prints even numbers from 2 to 10 using a loop.
[advanced] Draw a flowchart that asks the user to enter a password repeatedly until the correct password 'secret' is entered.