That's so fetch
Feelin' loopy
Decisions Decisions
Generally speaking
Code for your life
100

This function is used to gather input and include spaces.

getline()

100

Which loop is guaranteed to execute at least once?

do-while

100

in C++, the relational operators of AND and OR are represented by what?

&& - AND

|| - OR

100

Why is it generally bad practice to use the standard namespace?

name collisions. If you create a function with the same name in the standard namespace, C++ won't know which to select.


100

string name = "Harry Potter"

Provide the code needed to make a substring for the word "Potter"

name.substr(6,12);

OR

int pos = name.find('p');

name.substr(pos, 12);

200

To format output to currency, I would need to add these two functions to my cout statement.

fixed and setprecision()

200

This keyword is required to successfully break out of an infinite loop

break

200

This is the name given to a branching technique that mimics if statements, but immediately stores the result inside of a variable.

Ternary

200

This is the first step in the C++ compilation process to gather our enhanced source code.

Preprocessing


BONUS + 200

What step in the C++ compilation process gives us our object code?

200

Cast the following float variable to an int datatype safely.

float num = 3.14;

int newNum = static_cast<int>(num);

300

A datatype that often replaces ints in a for loop to count more realistic items

size_t


BONUS + 200

What is the memory limit for the size_t datatype?

300

for(i = 0; i > 3; i++)

What is wrong with the above for loop? [Give 2 issues]

missing datatype in initialization 

Incorrect stopping condition

300

In a switch, to account for any missing scenarios, it's best to have a ____ case.

default case.

300

This variable acts as an alias to an already existing variable. 

reference variable

300

Implement the following function prototype.

float divideNumbers(float a, float b);

if (b == 0) { 

cerr << "cant divide by zero ";

return 0.0;}

return a/b;

400

If i want to include enumerated values for my input, I would need to _____ the >> operator.

overload

400

while (______) 

finish the while condition to repeat until a number turns negative

while(number >= 0)

400

In a non-void function, every possible branch must eventually do what?

Return a value

400

What is the difference between a stream and a buffer?

A stream moves data from one source to some destination. (Input/Output)

A buffer is a temporary storage for data within a stream. (Variable)

400

The user inputted a string value for an int datatype. Safely handle this error and ask the user to re-enter input.

while(cin.fail()){

cin.clear();

cin.ignore(numeric_limits<streamsize>::max(), '\n'))

cin >> input; }

500

If i want to append data to an output file, I would need to include this parameter to my outputFile object creation.

std::ios::app

500

This while loop expression validates whether or a not a character is a number.

while(isdigit(char))

500

enum Direction {NORTH, SOUTH, EAST, WEST};

using a switch for this enum, the value EAST will be apart of what numbered case?

2

500

What is meant by the term "Dangling Reference"

A reference pointing to a memory location that no longer exists/no longer valid.

500

int num = 12345

append the number 6 to the end of this variable.

num = num * 10 + 6