Lesson 3 Logical Structure/Decision Flashcards

1
Q

What is a branch?

A

A branch is a sequence of statements executed only under a certain condition

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is a decision?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is an “if” branch? (simple if statement)

A

A decision who’s “else” branch has no statements

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is an equality operator?

A

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)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is a relational operator?

A

A relational operator checks how one operands value relates to another like (greater than or less than)

one or two character sequence (>, <, >=, <=)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Precedence rules

A
  1. () parentheses
  2. logical not
    • / % + -
  3. <, <=, >, >= relational operators
  4. ==, != equality and inequality operators
  5. and (logical and)
  6. or (logical or)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly