CS1140 Chapter 3: Selections

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/29

encourage image

There's no tags or description

Looks like no tags are added yet.

30 Terms

1
New cards

flowchart

A diagram representing a process, problem, or computer algorithm.

2
New cards

lazy operator

An operator that does not evaluate all its operands.

3
New cards

operator associativity

Determines the order of evaluation for operators of the same precedence.

4
New cards

operator precedence

Rules determining which operators are evaluated earlier in an expression.

5
New cards

selection statement

Used for programming with alternative courses of action.

6
New cards

short-circuit operator

An operator that stops evaluating subexpressions once the result is known.

7
New cards

boolean data type

A data type that can store a true or false value.

8
New cards

Boolean expression

An expression that evaluates to a Boolean value.

9
New cards

Boolean value

Either true or false.

10
New cards

conditional operator

A ternary operator used to evaluate expressions conditionally.

11
New cards

dangling else ambiguity

An ambiguity in nested if-else statements where an else might be paired with the wrong if.

12
New cards

debugging

The process of finding and fixing errors in program code.

13
New cards

fall-through behavior

When execution continues into the next switch case because a break statement is omitted.

14
New cards

Boolean variable storage

A boolean-type variable can store a true or false value.

15
New cards

Relational operators

Operators like

16
New cards

Types of selection statements

One-way if, two-way if-else, nested if, multi-way if-else, switch, and conditional operators.

17
New cards

If statement control decisions

Control decisions are made based on the true or false evaluation of a Boolean expression.

18
New cards

Boolean operators in Java

The operators &&, ||, !, and ^ operate with Boolean values and variables.

19
New cards

Short-circuit AND (&&)

Evaluates p1 first, then evaluates p2 only if p1 is true.

20
New cards

Short-circuit OR (||)

Evaluates p1 first, then evaluates p2 only if p1 is false.

21
New cards

Switch statement expression types

Can be of type char, byte, short, int, or String.

22
New cards

Switch break keyword

Optional, used at the end of each case to skip the remainder of the switch statement.

23
New cards

Expression evaluation order

Determined by parentheses, operator precedence, and operator associativity.

24
New cards

Parentheses in expressions

Can be used to force the order of evaluation to occur in any sequence.

25
New cards

Precedence evaluation rule

Operators with higher precedence are evaluated earlier.

26
New cards

Binary operator associativity

All binary operators except assignment operators are left associative.

27
New cards

Assignment operator associativity

Assignment operators are right associative.

28
New cards

Missing break in switch

If a break statement is not present, the next case statement will be executed.

29
New cards

Associativity for same precedence

Determines the order of evaluation for operators of the same precedence.

30
New cards

Conditional statement purpose

Selection statements provide alternative courses of actions in programming.