{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Program Flow

# Program Flow - ProgramFlow Sequentialcontrol itseesanend...

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

Program Flow:  Sequential control   The computer executes each statement  and goes on to the next statement until  it sees an end.

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

View Full Document
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
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

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

View Full Document
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
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

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 20

Program Flow - ProgramFlow Sequentialcontrol itseesanend...

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

View Full Document
Ask a homework question - tutors are online