Chapter 4 Control Structures Flashcards

1
Q

What is a switch statement?

A

A switch statement is an efficient way to select a code block to execute based on the value of a variable or expression.

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

What is a conditional operator?

A

This is a ternary operator that evaluates a simple if..else statement.

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

What are the different types of control? Define them.

A

Sequential (default), selection (conditionals), and repetition (loops).

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

What are the logical operators?

A

Negation (!x), AND (&&), and OR (||).

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

What is the conditional operator?

A

The testExpression ? ifTrue : ifFalse.

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

What is a global variable?

A

Declared outside all the scopes and can be used anywhere with :: .

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