(5) Loops Intro (Sina)

(5) Loops Intro (Sina) - LOGICAL Operators and Loops...

Info iconThis preview shows pages 1–10. Sign up to view the full content.

View Full Document Right Arrow Icon
LOGICAL Operators and Loops Introduction Fall 2009 Sina Meraji
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
In this session ± More examples on stuff we have learnt so far ± LOGICAL expression ± LOGICAL data type ± LOGICAL operators ± Introduction to loops
Background image of page 2
LOGICAL Expression Facts : ± Girls do not care about age .FALSE. ± I am not reading this .FALSE. ± We will miss G. Bush .TRUE.!! Reasoning : ± All apples are fruit .TRUE. Some apples are red .TRUE. Therefore some fruit is red .TRUE.
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
LOGICAL data type LOGICAL :: food_is_not_ready = .TRUE. IF (food_is_not_ready) THEN WRITE(*,*) “Please cook me a dinner. .!” ELSE WRITE(*,*) “Thanks mom…!” END IF
Background image of page 4
LOGICAL operators .TRUE. .TRUE. .TRUE. .FALSE. .FALSE . .TRUE. .FALSE. .TRUE. .FALSE . .FALSE. .FALSE . .FALSE . A .AND. B B A AND A : I have a driving license B : I have enough money to rent a Porsche I can drive a Porsche
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
LOGICAL operators .TRUE. .TRUE. .TRUE. .TRUE. .FALSE. .TRUE. .TRUE. .TRUE. .FALSE. .FALSE. .FALSE. .FALSE. A .OR. B B A .FALSE. .TRUE. .TRUE. .FALSE. .NOT. A A OR NOT
Background image of page 6
LOGICAL operators .TRUE. .TRUE. .TRUE. .FALSE. .FALSE. .TRUE. .FALSE. .TRUE. .FALSE. .TRUE. .FALSE. .FALSE. A .EQV. B B A Equivalence .FALSE. .TRUE. .TRUE. .TRUE. .FALSE. .TRUE. .TRUE. .TRUE. .FALSE. .FALSE. .FALSE. .FALSE. A .NEQV. B B A Not Equivalence
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Precedence and Associativity Left 4 .EQV. Left 5 .NEQV. Left 3 .OR. Left 2 .AND. Right 1 .NOT. Associativity Precedence Operator
Background image of page 8
.NOT. .TRUE. .AND. .FALSE. --> [.NOT.
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 10
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/15/2010 for the course COMP COMP 206 taught by Professor Vybihal during the Spring '04 term at McGill.

Page1 / 23

(5) Loops Intro (Sina) - LOGICAL Operators and Loops...

This preview shows document pages 1 - 10. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online