0% found this document useful (0 votes)
480 views3 pages

U5l11 Activity Guide - Flowcharts With While Loops

This document provides an introduction to while loops. It explains that while loops allow repeated execution of code as long as a condition is true. Students are asked to analyze real-life examples of while loops using flowcharts and indicate how many times each loop would run. They are also asked to write sample outputs for simple while loop programs. The goal is to help students visualize and understand how while loops control program flow.

Uploaded by

api-372568750
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
480 views3 pages

U5l11 Activity Guide - Flowcharts With While Loops

This document provides an introduction to while loops. It explains that while loops allow repeated execution of code as long as a condition is true. Students are asked to analyze real-life examples of while loops using flowcharts and indicate how many times each loop would run. They are also asked to write sample outputs for simple while loop programs. The goal is to help students visualize and understand how while loops control program flow.

Uploaded by

api-372568750
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Unit 5 Lesson 11

Name: Sara Kaufman Period: 3 Date: 1/16/2020


 

  Activity Guide - Flowcharts with ​while​ Loops 

Introduction 

We are going to be learning a new programming structure today called ​while​ ​loops. ​while​ loops allow us to
control program flow by repeating a set of commands until a condition is met. ​ When we control program flow it
is often helpful to think about the ideas in a visual way first. You will use flowcharts to begin thinking about ​while
loops.

Flowchart Components 

As a reminder we have included the flowchart components here as a reference for you as you work on this sheet.

Real-Life ​while​ Loops  

Each flowchart below contains a “loop” that runs “while” a condition is true.​ Investigate each flowchart, mark
how many times you believe the loop will run on the line provided, and then justify your reasoning.
Note: ​There may be many possible answers, so pick the one you believe makes the most sense.

How many times will the loop run?

|-------------------------------------------------|
Never ​ ​A few times​ Forever
Justification: The loop would only run while the person needs more sleep.
How many times will the loop run?

|-------------------------------------------------|
Never ​ ​A few times​ Forever
Justification: The loop would run while the person does not understand something.

Complete this flowchart with a real-life ​while​ loop of your own choosing. Exchange with a partner and see
how many times they think your loop would run.

Programming with ​while​ Loops 


The next two examples begin making the transition from real-life ​while​ loops to ones you might see while
programming. ​Use the space provided to write the output that would be generated from the program.

Output:

This would never run because the


counter is adding one, but the end
result, to display “Done!” would only
occur if it were less than 5.

2
Output:

This would not work, since 3 is not a


multiple of 10.

You might also like