Variables, data types
Basic C++
Branching & Random
Repetition/looping
Functions
100

This data type can only hold whole numbers

integer, int

100

THIS line of code lets you use simplified syntax in C++

using namespace std;

100

rand()% 10 + 1 generates random integers between one and THIS

10

100

You can use THIS shortcut to increase the value of a variable by 1

++

(i++, variable++)

100

THIS is one benefit of using functions

Shorter development time

Simpler iteration and testing of sub-components of code

Less duplication of code

Programming solutions that are easier to maintain

200

This variable type, used to express True or False, is named after the English mathematician George Boole

Boolean variables

200

THIS command can be used to get input from the user (also indicate the direction of the carets)

cin >>

200

In order to get different random numbers, you need to "plant a seed" by using THIS command before calling the rand function

srand(time(0))

200

Use THIS loop when you know how many times the code should repeat

for loop

200

THIS kind of function doesn't return anything

VOID

300

These are letters, symbols, and numbers that will not be used in calculations

characters (also accept string)

300

THIS command inserts a new line in an output statement

endl (also accept \n)

300

var = true || false;

THIS is the value of var

TRUE

300

Use THIS loop when you want the code to run once before checking the condition

do-while loop

300

Consider the following function header:

int someFunction(char letter, int number)

THIS is the data type of the value returned

int, integer

400

Allocated memory, value range, and THIS are the differences between float and double data types

precision (number of decimal places)
7 for float, 15 for double

400

THIS character is used to end statements and appears at the end of (almost) every line

semicolon, ;

400

THIS operator is used to check if two values are not equal in an if statement

!=

400

Use THIS loop when you want to check a condition before repeating code

while loop

400

THIS kind of variable can only be used in the function it is defined in

local variable

500

This is when you declare a variable and assign an initial value in one line

initializing

500

Include THIS library in order to format your output statements

<iomanip>

500

THIS command tells the computer to leave the switch statement at that point

break, break statement

500

If you want the for loop to run 6 times, what could THIS be:

for (int i = 0; THIS; i++)


i < 6;

i <=5;

500

THIS is the location of a function prototype or declaration

above the main function/loop

M
e
n
u