Unit 3 : Algorithm Selection Flashcards

1
Q

What does the selection control structure represent? ( 2 )

A
  1. Represents the decision making capabilities of computer
  2. Used to illustrate a choice between two or more actions depending on whether the condition is true or false
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is a condition? ( 2 )

A
  1. Comparison between 2 items
  2. Return True or False as answer
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

List out all the relational operators and the meaning ( 6 )

A
  1. < Less than
  2. > Greater than
  3. == Equal to
  4. <= Less than or Equal to
  5. > = Greater than or Equal to
  6. != / <> - Not equal to
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are logical operators?

A
  1. Used to create relational expressions from other relational expressions
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

List out all the logical operators ( 3 )

A
  1. && - and, returns true if both expressions are true
  2. || - or, return true if either expression is true
  3. ! - not, returns true if none of the expression is true
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the peudocode of selection control structure?

A

IF ( condition ) THEN
//statement1
ELSE
//statement2
ENDIF

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

What is the noun of this meaning? “A choice is made between two alternative paths, depending on the result of a
condition being true or false”

A
  1. Selection Control Structure
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

List out all the selection control structure ( 4 )

A
  1. Simple Selection ( Simple IF statement )
  2. Simple Selection with null false branch ( null ELSE statement )
  3. Combined Selection (Combined IF statement with using AND , OR , NOT )
  4. Nested Selection ( Nested IF statement , means if inside another if )
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the keyword for selection control structure? ( 5 )

A
  1. IF
  2. THEN
  3. ELSE
  4. ELSEIF
  5. ENDIF
How well did you know this?
1
Not at all
2
3
4
5
Perfectly