GENERAL
CONDITIONS
SELECTION
LOOPS
VALIDATION
100

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

What is declare it?

100

C++ uses these for more readable conditional values compared to using 1 and 0.

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?

100

People WILL enter bad data, so you should do this.

What is validate user input?

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 general loop statement takes only a condition and will not execute if its condition is initially false.

What is a while loop?

200

This loop is best for data validation because it always executes at least once.

What is a do 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?

300

This lets you detect that the user entered a string when cin is attempting to retrieve an integer.

What is cin.fail()?

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?

400

This occurs when cin.ignore() is called with no parameters.

What is a single character dropped from the stdin buffer?

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?

500

Use this after you’ve tested for bad data entry and dealt with it.

What is cin.clear()?

M
e
n
u