Variables
Conditionals
Functions
Vectors
100

What default types of variables are there?

Int, double, string, float, char

100

What operator would you use to check if two statements are both true?

&&

100

What's the difference between arguments and parameters?

Parameters are variables the function knows exists when defined, and arguments are variables passed into the function when called.

100

for (int i = 0; i < 4; i++) {

   for (int j = 0; j < 5; j++{

      cout << i << " ";

   }

   cout << endl;

}

1 1 1 1  

2 2 2 2  

3 3 3 3 

200

How would you declare an integer named x with the value of 23?

int x = 23;

200

What's the result of this loop running?

for (int i = 0; i < 3; i++) {

    for (int j = 0; j < 5; j++) {

        cout << j;

    }


}

  012340123401234

200

When would you pass by reference?

When you want to change a variable in a function without returning a value. 

200

What error is thrown when accessing one more than the max index in a string?

string::npos

300

What is the result of 20 % 3?

2

300

When would you want to use two if statements in a row instead of an if/else block?

To check both if statements.

300
What's another way to change a variable passed into a function?

Assign it with the return value (which will be the changed variable) in the function.

300

In a function where you print every value in a vector of ints named v, how should you pass v to the function?

(const vector<int> &v)

400

What type of variable would you use to iterate through the indexes of an array?

unsigned int

400

What operator has the highest convention against other conditionals?

()

400

When a function returns from it's call, do its local variables keep their values?

No. Their values are discarded in memory.

400

What is selection sort?

Find the minimum element, move to the first position, then continue from the second position.