Tuesday, April 26, 2011

Lesson 16 Source Code

List of videos Lesson 16 Video
Lesson 16: The while loop NOTE: for a fast copy, follow these steps in order:
  1. Click anywhere in a text box below (result will be a blinking vertical line in the text box)
  2. Hit ctrl + A on the key board (the "ctrl + A" means hit Ctrl and A at the same time) (The result should be that all the text inside the text box lights up in blue)
  3. Hit Ctrl + C (Nothing significantly happens that is visible) and now its copied to the clipboard and your ready to paste it anywhere you wish
beginning while loop examples
This will print my name 5 times to the screen This program code will count from 0 to 24 This program will NEVER END. This is a common bug called the infinite loop This program will double the value of "a" and print it out to the screen until a is greater than 500 (NOTE: There is only 1 difference compared to the program above this one) This program will dived a by 2 each time until a is 0;

No comments:

Post a Comment