Unit 3 : Algorithm Selection Flashcards
1
Q
What does the selection control structure represent? ( 2 )
A
- Represents the decision making capabilities of computer
- Used to illustrate a choice between two or more actions depending on whether the condition is true or false
2
Q
What is a condition? ( 2 )
A
- Comparison between 2 items
- Return True or False as answer
3
Q
List out all the relational operators and the meaning ( 6 )
A
- < Less than
- > Greater than
- == Equal to
- <= Less than or Equal to
- > = Greater than or Equal to
- != / <> - Not equal to
4
Q
What are logical operators?
A
- Used to create relational expressions from other relational expressions
5
Q
List out all the logical operators ( 3 )
A
- && - and, returns true if both expressions are true
- || - or, return true if either expression is true
- ! - not, returns true if none of the expression is true
6
Q
What is the peudocode of selection control structure?
A
IF ( condition ) THEN
//statement1
ELSE
//statement2
ENDIF
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
- Selection Control Structure
8
Q
List out all the selection control structure ( 4 )
A
- Simple Selection ( Simple IF statement )
- Simple Selection with null false branch ( null ELSE statement )
- Combined Selection (Combined IF statement with using AND , OR , NOT )
- Nested Selection ( Nested IF statement , means if inside another if )
9
Q
What is the keyword for selection control structure? ( 5 )
A
- IF
- THEN
- ELSE
- ELSEIF
- ENDIF