I Want Arrays
Pointer? I Barely Know Her
In a Class By Itself
It's All Relative
A Random Walk
100

This code is possible:

int arrA[5] = {1, 2, 3, 4, 5};

int arrB[5] = arrA;

What is no? 

100

True/False: Call-by-value uses pointers to change the values of contents of memory.

What is true?

100

This keyword overrides a virtual function

What is override?

100

These are the four pillars of Object Oriented Programming.

What are abstraction, encapsulation, inheritance, polymorphism? 

100

If you use cin for the following string: “hiThere?Bob%how AreYou?” what will the cin read in?

What is hiThere?Bob%how?

200

int arrA[5]; 

True or False: &arrA[0] is equivalent to arrA

What is true? 

200

When dealing with pointers, this is the difference between * and &?

Various answers.

200

This keyword gives ordinary functions access to private members

Friend

200

In a descendent, which of these functions are inherited:

  1. Constructor

  2. Destructor

  3. Setters

  4. Assignment operator 

What are setters?
200

Name a difference between classes and structs.

"The only difference is that class members and inheritance are private by default and struct members and inheritance are public by default." 

300

Assume you have an object Rational. If you write Rational arrA[10], what are the objects initialized to?

  1. They’re not initialized until you actually create them. 

  2. The default constructor

  3. 0

What is 2? 

300

What is wrong with this code:


int main() {

    Rational *r = new Rational();

    r->display();

    return 0;

}

No delete statement

300

This keyword uses late binding to make an entry into a  in the virtual table tolookup the function at runtime based on object.

What is virtual?

300

The relationship between base and derived is known as;

  1. Is-a

  2. Has-a

  3. Was-a

  4. None of the above

What is is-a?

300

A class with a pure virtual function is known as:

  1. Virtual class

  2. Abstract class

  3. Complex class

  4. Protected class

What is an abstract class?

400

When creating a function dealing with an array, you should include these two parameters.

What are the array and the size of the array? 

400

True or false: To avoid the slicing problem, you should use call-by-value in your object functions.



What is false?
400

This keyword limits the scope, but puts it in global space

What is static?

400

 True/false: you can access protected functions in the derived class.

What is true?

400

Which of these operators cannot be overloaded:

  1. +

  2. %

  3. >>

  4. None of the above.

What is none of the above?

500

This removes the last value from a vector

  1. .remove()

  2. .push_back()

  3. .pop_back()

  4. .delete()

What is pop_back()?

500

 Fill in the blank:

Rational r;

Rational *rPoint = &r;

*rPoint[blank]print(); 



What is ->?

500

Explain the difference between the static and instance function of a class

Varied answers

500

True/false: when destructing an inherited object, parents are destructed before children.

What is false?

500

What’s the correct code to create a template prefix?

template <class TypeName>

template <typename TypeName>

M
e
n
u