Program Flow - ProgramFlow: Sequentialcontrol

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

View Full Document Right Arrow Icon
Program Flow:  Sequential control   The computer executes each statement  and goes on to the next statement until  it sees an end. 
Background image of page 1

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

View Full DocumentRight Arrow Icon
Program Flow:  Boolean Expressions   Boolean expressions are used to compare  two values and get a true-or-false answer:  value1  relational_operator  value2   The following relational operators are used:  < less than > greater than = equal to <= less than or equal to >= greater than or equal to <> not equal to
Background image of page 2
Program Flow:  Boolean Expressions   We can assign Boolean expressions to Boolean  variables. Here we assign a true expression to  some_bool some_bool := 3 < 5;  Complex Boolean expressions are formed by using  the Boolean operators:  not negation (~) and conjunction (^) or disjunction (v) xor exclusive-or
Background image of page 3

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

View Full DocumentRight Arrow Icon
Program Flow:  Boolean Expressions   NOT  is a unary operator — it is applied  to only one value and inverts it:  not true = false  not false = true  AND  yields TRUE only if both values  are TRUE:  TRUE and FALSE = FALSE  TRUE and TRUE = TRUE 
Background image of page 4
Program Flow:  Boolean Expressions   OR  yields TRUE if at least one value is TRUE:  TRUE or TRUE = TRUE  TRUE or FALSE = TRUE  FALSE or TRUE = TRUE  FALSE or FALSE = FALSE  XOR  yields TRUE if one expression is TRUE and the  other is FALSE. Thus:  TRUE xor TRUE = FALSE  TRUE xor FALSE = TRUE  FALSE xor TRUE = TRUE  FALSE xor FALSE = FALSE 
Background image of page 5

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

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

This note was uploaded on 01/02/2012 for the course CHEM E 101 taught by Professor Mr.yuswan during the Spring '11 term at Universitas Indonesia.

Page1 / 20

Program Flow - ProgramFlow: Sequentialcontrol

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

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