Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 © 2002 John Urrutia. All rights reserved. Qbasic Chapter 4 IF Statements and READ & DATA.

Similar presentations


Presentation on theme: "1 © 2002 John Urrutia. All rights reserved. Qbasic Chapter 4 IF Statements and READ & DATA."— Presentation transcript:

1 1 © 2002 John Urrutia. All rights reserved. Qbasic Chapter 4 IF Statements and READ & DATA

2 2 © 2002 John Urrutia. All rights reserved. Boolean or Logical Expressions Algebra created by George Boole Always evaluates to a binary state  Generally:  1 is TRUE  0 is FALSE

3 3 © 2002 John Urrutia. All rights reserved. Relational Expressions Single relational operator two operands  <Less than  >Greater than  =Equal to  <=Less than or equal to  >=Greater than or equal to  <>Not equal to

4 4 © 2002 John Urrutia. All rights reserved. One-way Selection Down the primrose path or another IFy situation.  IF condition THEN statement(s) END IF

5 5 © 2002 John Urrutia. All rights reserved. Two-way Selection There’s more than one-way to skin a turkey.  IF condition THEN statement(s) ELSE statement(s) END IF

6 6 © 2002 John Urrutia. All rights reserved. Nested IF Statements IF condition THEN statement(s) ELSE statement(s) END IF ELSE statement(s) END IF

7 7 © 2002 John Urrutia. All rights reserved. Multi-way Selection IF condition THEN statement(s) ELSEIF condition THEN statement(s) ELSEIF condition THEN statement(s) ELSE statement(s) END IF

8 8 © 2002 John Urrutia. All rights reserved. Logical Operators Op-1Op-2ANDORXOR True False TrueFalse True FalseTrueFalseTrue False

9 9 © 2002 John Urrutia. All rights reserved. Operator Precedence Order of evaluation  ^Exponent  + or -Unary (sign)  *, /, \, MODArithmetic , =, <>, =  NOT, AND,Logical operators OR, XOR

10 10 © 2002 John Urrutia. All rights reserved. DATA & READ statements DATA const, const, const, …  Provides internal storage  Accessed sequentially READ var, var, var, …  Populates variables from DATA RESTORE label  Resets the some or all the DATA


Download ppt "1 © 2002 John Urrutia. All rights reserved. Qbasic Chapter 4 IF Statements and READ & DATA."

Similar presentations


Ads by Google