Computer Programming Week 5-8 Vocabulary: Relational, Logical Operators, and Switch/Decision Structures

0.0(0)
studied byStudied by 0 people
GameKnowt Play
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/13

flashcard set

Earn XP

Description and Tags

Vocabulary flashcards covering relational operators, compound assignments, logical operators (including OR and NOT), the conditional operator, and switch/decision structures based on the notes.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

14 Terms

1
New cards

Relational operators

In C++, operators that compare two values and yield a boolean result (true or false); commonly used in conditional statements like if, while, and for loops to control program flow.

2
New cards

True/false result

Relational operators produce a boolean result: either true or false.

3
New cards

Conditional statements

Structures like if, while, and for that use relational or logical expressions to control the flow of a program.

4
New cards

Compound assignment operators

Operators that modify a variable by applying an operation and reassigning the result; examples include +=, -=, *=, /=, %=, >>=, <<=, &=, ^=, |=.

5
New cards

Logical operators

Operators that connect two or more expressions to determine the logic behind decisions; essential for controlling program flow in conditional statements.

6
New cards

Logical OR (||)

A logical operator that yields true if either operand is true and supports short-circuit evaluation (evaluates left operand first and may skip the right if the left is true).

7
New cards

Short-circuit evaluation

A property where evaluation stops as soon as the overall result is determined, commonly seen with the logical OR (and AND) operators.

8
New cards

Logical Not (!)

The unary operator that negates a boolean expression; takes a single argument.

9
New cards

Conditional operator (?:)

The ternary operator that takes three operands and forms a conditional expression.

10
New cards

Decision (Selection) Control Structure

Control structures that allow selecting and executing specific blocks of code while skipping others.

11
New cards

Switch statement

A control structure that executes a block of code among many alternatives by comparing a switch expression to case labels; easier to read than a long if-else chain.

12
New cards

Case label

A constant value in a switch statement that, when matched with the switch expression, activates its corresponding block of code.

13
New cards

Default

The block of code in a switch statement that executes if no case label matches the switch expression.

14
New cards

Break

A statement used inside a switch to exit the current case block, preventing fall-through to subsequent cases.