1 / 8

Repetition - Looping

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.

loril
Download Presentation

Repetition - Looping

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Repetition - Looping

  2. Control Structures • Sequential • Do Together • Do In Order • Conditions / Decisions • Repetition / Loop • Counted • While Loop

  3. Looping • Repeating Behavior • Sequential Instructions • Methods

  4. Counted Loop • Know how many times we need a block of instruction to repeat • Jump up and down 5 times • Uses a Counter

  5. Example • Create a world with a Ferris Wheel. When the space bar is pushed, have the ferris wheel move around 5 times.

  6. 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

  7. Ferris Wheel – While Loop • Modify the ferris wheel program to continue going around until a switch is turned off.

  8. Homework • Chapter 7 • 3, 4, 5 & 8

More Related