Summer SAVY 2017, Session 4/Day 2- Intro to Programming (Rising 6th/7th)
Today we started working on iteration with While Loops. We learned that While Loops need three parts:
1. A loop control variable that is initialized before the loop,
2. The loop statement (while ____:) that continues the loop until the condition after “while” is False, and
3. A way to update the loop control variable inside the loop to prevent an infinite loop
In the morning, students practiced creating loops with two mini-projects. In the first mini-project, they summed a series of numbers input by a user. In the second mini-project, they created a program that generates Fibonacci numbers.
By the end of the day, students were able to start planning code for their first game – a guessing game in which the computer randomly generates a number and provides the player with feedback about whether each guess is too high, too low, or just right. Tomorrow, we will begin coding these games and, we hope to also start working with lists, a more complex data structure.
Ms. Ashlyn Karan
Leave a Response