GENERAL
CONDITIONS
SELECTION
LOOPS
100

You must do this to a variable before it can be used.

What is declare it?

100

This is more readable than 1 and 0 for the value of a conditional.

What are true and false?

100

This selection statement allows you to use compound expressions and relational operators.

What is an if statement?

100

Use this when you know how many times you want to execute a loop.

What is a for loop?

200

You should do this to a variable before you use its value.

What is initialize it (i.e., set it to a value)?

200

Use these delimiters around a condition.

What are parentheses?

200

This selection statement allows you to choose between multiple characters or integers.

What is a switch statement?

200

This very general loop will not execute if its condition is initially false.

What is a while loop?

300

Use this statement, so you don’t have to write std::cin, std::cout, and std::endl.

What is using namespace std;?

300

After ! (i.e., not), this logical operator has the highest precedence.

What is && (i.e., and)?

300

The selection statement below has this logical error.

if (x > 7); 
{ 
    cout << “false”; 
}

What is the ; after the condition?

300

With which loop can you easily replace a for loop?

What is a while loop?

400

This is how you can retrieve input from the console and store it in num.

What is cin >> num;?

400

For this logical operator, the expression on its right will NOT be executed, if the one on its left is true.

What is || (i.e., or)?

400

These delimiters should go around multiple lines of code you want to execute when the condition for an if statement is true.

What are curly braces { }?

400

Although you could, you should NOT use this to terminate a loop.

What is break?

500

This shorthand allows you to add 1 to num.

What is num++ OR ++num OR num+=1?

500

For this logical operator, the expression on its right will NOT be executed, if the one on its left is false.

What is && (i.e., and)?

500

For a switch statement, this is like an if statement’s else.

What is default?

500

Although you could, you should NOT use this to skip a loop iteration.

What is continue?

M
e
n
u