Control II

# Control II - Learning Goals Department of Computer Science...

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

1 Flow of Control Part I Department of Computer Science APSC 160 Flow of Control Part II Learning Goals By the end of this section, you should be able to: • read and write simple Boolean expressions using relational operators • read and write compound Boolean expressions using the and , or and not operators Boolean expressions Boolean expressions The following relational operators are used to construct Boolean expressions: < less than > greater than <= less than or equal to >= greater than or equal to != not equal to == equal to Boolean expressions Examples: count < nChars count % 2 == 0 count % 2 != 0 Compound Boolean expressions The following logical operators that can be used to combine Boolean expressions to form compound Boolean expressions: && and (binary operator) || o (binary operator or (binary operator) ! not (unary operator)

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

View Full Document
2 Compound Boolean expressions The and operator – evaluates to true if and only if both the operands evaluate to true: p q p && q true true
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 2

Control II - Learning Goals Department of Computer Science...

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

View Full Document
Ask a homework question - tutors are online