You must do this to a variable before it can be used.
What is declare it?
This is more readable than 1 and 0 for the value of a conditional.
What are true and false?
This selection statement allows you to use compound expressions and relational operators.
What is an if statement?
Use this when you know how many times you want to execute a loop.
What is a for loop?
You should do this to a variable before you use its value.
What is initialize it (i.e., set it to a value)?
Use these delimiters around a condition.
What are parentheses?
This selection statement allows you to choose between multiple characters or integers.
What is a switch statement?
This very general loop will not execute if its condition is initially false.
What is a while loop?
Use this statement, so you don’t have to write std::cin, std::cout, and std::endl.
What is using namespace std;?
After ! (i.e., not), this logical operator has the highest precedence.
What is && (i.e., and)?
The selection statement below has this logical error.
if (x > 7); { cout << “false”; }
What is the ; after the condition?
With which loop can you easily replace a for loop?
What is a while loop?
This is how you can retrieve input from the console and store it in num.
What is cin >> num;?
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)?
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 { }?
Although you could, you should NOT use this to terminate a loop.
What is break?
This shorthand allows you to add 1 to num.
What is num++ OR ++num OR num+=1?
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)?
For a switch statement, this is like an if statement’s else.
What is default?
Although you could, you should NOT use this to skip a loop iteration.
What is continue?