Logical Expressions
If & Else Statements
Switch Statements
Strings and Functions
Rand()
100

This built in C++ data type can hold the values true and false.

Bool

100

This term describes the grouping of one or more statements between curly braces { }

What is a block statement?

100

This statement is used to jump to the end of a switch structure and skip all remaining branches.

break

100

 This is the index number of the very first character in any C++ string

0

100

This specific library header must be included to use the rand() and srand() functions

<cstdlib>

200

This C++ operator is used specifically for equality testing, not for assignment.

==

200

This practice makes code easier for humans to read and understand, though the computer ignores it

Indentation

200

Unlike an if statement, the expression used in a switch statement must be of this general type

An integral type (i.e. int)

200

This operator is used to perform "concatenation," which joins two strings together

+

200

To ensure "really random" numbers on every program run, programmers often seed the generator with this.

The current time system, i.e. time(0);

300

This logical operator returns true only if both of its operands are true.

&&

300

An if statement placed inside the block of another if statement is known as this

What is a nested if statement?

300

This optional branch is executed only if no matching case is found in the switch structure

What is the default case?

300

This string member function returns the number of characters currently in a string.

What is length()?

300

The rand() function yields a random integer between 0 and this implementation-dependent constant

what is RAND_MAX?

400

In C++, a condition is represented by a logical expression. According to DeMorgan's Law, the expression !(A && B) can be rewritten as this logically equivalent statement

What is !A || !B?

400

Proper indentation is crucial for human readers, but the computer ignores it. If a programmer accidentally places a semicolon immediately after the condition, for example, if (x < y); the compiler will interpret that semicolon as this.

What is a null statement?
400

 True or False: C++ switch statements allow you to check for a range of values, such as case 90-100:

False

400

Strings are compared using this type of ordering, which is similar to "dictionary order"

What is lexicographical order?

400

Random numbers generated by a computer are often called this because they eventually repeat

Psuedorandom numbers

500

This logical operator returns the negation of its operand.

! or NOT

500

In an if-else statement, this block specifies the actions to take when the condition is false.

The else block

500

his is the term for the constant expression attached to a branch in a switch statement

What is a label?

500

This member function takes two parameters (start and length) to extract a portion of a string

substr()

500

This is the formula (using a as the start and b as the end) to obtain a random value in a specific range

rand() % (b - a + 1) + a

M
e
n
u