80 likes | 88 Views
Learn about sequential, do together, and do in order control structures, as well as conditions and decisions. Understand counted and while loops for repeating behavior and sequential instructions. Practice with examples and exercises.
E N D
Control Structures • Sequential • Do Together • Do In Order • Conditions / Decisions • Repetition / Loop • Counted • While Loop
Looping • Repeating Behavior • Sequential Instructions • Methods
Counted Loop • Know how many times we need a block of instruction to repeat • Jump up and down 5 times • Uses a Counter
Example • Create a world with a Ferris Wheel. When the space bar is pushed, have the ferris wheel move around 5 times.
While Loops • Repeating block of instructions • Unspecified number of times • While a condition is true • While it is raining, use an umbrella • While the troll is more than 5 meters from the dragon, move toward dragon
Ferris Wheel – While Loop • Modify the ferris wheel program to continue going around until a switch is turned off.
Homework • Chapter 7 • 3, 4, 5 & 8