Tuesday, May 10, 2011

Lesson 11 Source Code

List of videos Lesson 11 Video
To get the full benefit of the lesson, watch the video Lesson 11: Introduction to the if statement 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

if statements
The if statement will only take bool parameter (value inside the paranthesis). The if statement will either skip or execute the following program statement depending on the boolean value of the if statement. Run both of these pieces of code. refer to the video for the detailed explanation. the if statement can also refer to code blocks (code inside curly braces) to skip multiple lines of code. you can input variables into th if parameter. You can also put in int, double, char, etc types but don't forget the rules of the boolean values that aren't true or false. Here are slightly more practical examples that might help you see why if statements are useful

No comments:

Post a Comment