Lesson 3 Logical Structure/Decision Flashcards
What is a branch?
A branch is a sequence of statements executed only under a certain condition
What is a decision?
A decision creates 2 branches: If the decision is true, the first branch executes, else the second branch executes.
Coral flowcharts use diamond symbol for a decision
What is an “if” branch? (simple if statement)
A decision who’s “else” branch has no statements
What is an equality operator?
An equality operator checks whether 2 operand values are the same (==) or different (!=)
An expression involving an equality operator evaluates to a Boolean value (true or false)
What is a relational operator?
A relational operator checks how one operands value relates to another like (greater than or less than)
one or two character sequence (>, <, >=, <=)
Precedence rules
- () parentheses
- logical not
- / % + -
- <, <=, >, >= relational operators
- ==, != equality and inequality operators
- and (logical and)
- or (logical or)