11.07.2015 Views

Here - 1000 BiT

Here - 1000 BiT

Here - 1000 BiT

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

INSTRUCTOR NOTES 12 THE IF COMMAND WITH NUMBERSThe IF command is extended to numeric expressions. The logic relations used in thislesson are:It is a good idea to get the student to pronounce these expressions out loud. "A < B"makes a lot more sense when pronounced "A is less than B" than when just allowed toflow in the eyeballs. Of course, the "point" of the < and the > symbols (that is, the littleend) points to the smaller of the two numbers.The use of nested IF s is demonstrated. This is a very powerful construction, but may beconfusing. It is worth while to go through the example with your student to make surethat the construction is understood.A "home made" loop is demonstrated in the GUESSING GAME, but not discussed. Theloop starts in line 50 and goes to 80. The exit test is made in line 57. The logic of this loopis that of a DO WHILE.QUESTIONS:1. What part of the IF command can be TRUE or FALSE?2. What follows the THEN in an IF command?3. After this little program runs, what will be in box D?10LETD=415IF3 7.n69

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!