FINALS Flashcards
are commands that enable a program to “take decisions”, following one path or another.
Control Structures
Control Structures are commands that enable a program to ____________ , following one path or another.
“take decisions
These are the blocks that analyze variables and choose directions in which to go based on given parameters.
Control Structures
3 types of Control Structures
Conditional Structures (or Selection)
Iteration Structures (or Looping)
Selective Structures (switch)
Conditional operator
(? :)
are used to execute one or more statements if a condition is met.
Conditionals (or Selection)
4 types of Conditional Structures
if statements
if else statements
if else if statements
Nested if statements
execute one or more statements when a condition is met. If the testing of that condition is TRUE, the statement gets executed. But if it’s FALSE (the condition is not met), then nothing happens.
If statements
This Control Structure allows a program to follow alternative paths of execution, whether a condition is met or not.
If else statements
can have multiple alternative statements.
If-else if statements
is an if statement that is the target of another if statement.
nested if
Use the s____________ to select one of many code blocks to be executed.
Switch statement
Multiple – Selection Structure
Switch
The switch expression is evaluated how many times?
once
The ______ and ________ keywords are optional.
break and default
When C++ reaches a _________ keyword, it breaks out of the switch block.
break