Constructors & Classes
Public Interface
Data Members
Member Functions
OOP
100

What is the definition of a class?

A blueprint that describes a set of objects with the same behavior.

100

True or false: You put data members in the public interface.

False: You want to protect the data members in the private interface.

100

Where are variables declared?

Private section

100

Which is constant, a mutator or an accessor?

An accessor 

100

What does OOP stand for?

Object Oriented Programming

200

True or false: The name of the constructor can be anything

False: Has to have the same name as the class

200

What are other names for mutators and accessors?

Mutators: setters

Accessors: getters

200

True or false: Each object has a separate copy of the data members. 

True

200

Which syntax is correct?

a) void Clock. reset()

b) void Clock: reset();

c) void Clock:: reset()

d) void Clock:: reset();

d) void Clock:: reset();

200

Which of the following is an attribute of Clock class?

a) Hour

b) Move hand

c) Reset clock

d) Page count

a) Hour

300

What is encapsulation?

The process of providing a public interface while hiding implementation details. 

300

What are the mutator and accessor in the given member functions?

double get_total() const;

void set_total();

void print_welcome();

Accessor: double get_total() const;

Mutator: void set_total();

300

Why are data members private?

To protect the state of the data members.

300

Where have we seen Object Oriented Programming before the introduction of classes?

In string objects, cin, and cout

400

A constructor is a special ______ function that initializes the _____  ________ of an object.

member; data members

400

Which is the implicit and explicit parameter?

person.set_age(13);

Implicit: person

Explicit: 13

500

What is wrong with this program?

class Box

{

    //code

};

Box(int length, double width)

{//code};

Box(int length, double width)
{//code};

You cannot have two constructors with the same number, type, and order of parameters.