Unit 2. Developing Programming Tools
Revision Date: Jun 11, 2020 (Version 3.0)Summary
Students continue learning about iteration by using while
loops and nested iteration. Students work through a guided tutorial on while
loops and learn more turtle graphics features. They also have the opportunity to utilize the pair programming model to facilitate collaboratively writing programs using for
loops, while
loops, and turtle graphics. Throughout the lesson, students are given the opportunity to use their journal as a reflective tool.
Outcomes
while
loops. for
and while
loops can be written (nested) inside of other for
and while
loops.Outline
for
and while
loops with turtle graphicswhile
loops. for
and while
loops can be written (nested) inside of other for
and while
loops.Student computer usage for this lesson is: required
In the Lesson Resources folder:
Other:
What will be displayed at the end of this program?
y=0
for x in range (0, 8):
y += 1
print (y)
Define the Pair Programming Model: As the name implies, pair programming is where two programmers share one computer. One programmer codes while the other observes the code as it is typed in. The two programmers switch roles frequently. Common models such as pair programming exist to facilitate collaboration.
Introduce the Activity:
Solutions to both programs are in the slideshow.
Open Repeat Loops.ppt in the Teacher Resourses.
Say: The College Board’s exam reference sheet uses REPEAT loops instead of for and while loops. The REPEAT n TIMES { } executes the block of statements n times.
The College Board's REPEAT UNTIL(condition) { } structure executes the block of statements without ending until the Boolean expression condition evaluates to true. If the condition never evaluates to true the loop coninue indefinitely (called an infinite loop).
In the REPEAT UNTIL(condition), the Condition is evaluated before the loop body is executed so if the condition evaluates to true the loop body is never execued.
Ask: Which of the two REPEAT loops is most like the Python for loop and which is most like the Python while loop?
Display the example REPEAT loops questions in the slideshow, one at a time. Give the students a moment to determine the answer, then prompt students for his/her response "How many chose Answer A?" Then do the same for B, C, D. Then give correct answer (answer is in the Notes section of the ppt).
Journal: In your journal, summarize the process that you used with your partner to create the collaborative project. How did each partner contribute? Did you have any differences, if so, how did you resolve them? Was there any benefits to working in a pair ie able to identify programming and/or algorithm errors?
Questions in the AP Classroom Question Bank may be used for summative purposes.
Sixty of the 80 questions are restricted to teacher access. The remaining 20 questions are from public resources.
Questions are identified by their initial phrases.
A summer camp offers a morning session and an a...
The code segment below uses the procedure IsFound
The figure below shows a robot in a grid of squ...
The figure below shows a robot in a grid of squ...
The procedure Draw (length, direction) is used to
Various checking-for-understanding techniques:
Quick quizzes
Peer review
Interactive journaling
Students will work collaboratively to develop a program that uses nested iteration and turtle graphics.