Intro to Class & Objects
Implementing Classes
Public Interface/Data Members
Member Functions
Constructors
100

What is a Class?

A class is the general category, or blueprint, of an object.
100

True or False: Member functions should be private.

False.

100

What is a mutator?

A mutator is a type of function used to modify private data members.

100

Where do you declare a member function?

In the public interface.

100

Why don't constructors have a return type?

They don't return anything.

200

What is a specific instance of a class?

An object

200

What are behaviors of an object?

Behaviors are what the object does: how it acts.

200

A function that does NOT modify any member variables should be marked as _______.

const

200

Where should member functions be implemented? Which syntax operator must be used?

Should be implemented outside the class definition using the double colon (::) operator.

200

What does a constructor initialize?

They initialize data members of an object.
300

Out of these attributes, which one of the following would be used for a Book class?

A. int author

B. double mileage

C. string title

D. string flavor

C. string title

300

How do you initialize an object?

Class name followed by Object name. (Example: for class name Counter, object name score, initialize by Counter score;)

 

300

Should a mutator function always return a value?

No. It should NOT return a value.
300

True or False: Member functions can have the same parameter names as private data members.

False.

300

The name of a constructor is _____ as its class name.

The same
400

What is encapsulation?

Encapsulation is the process of hiding private information that the user doesn't need to be wary of, as long as they can use it.

400

How would you invoke member functions?

Using the dot notation (.)

Ex: object.function_name()

400

What syntax MUST be included when invoking member functions?

dot notation (.)

function.action();

400

What 2 things do member functions use for values?

Private data members & parameters
400

What syntax operation should be used to declare constructors?

Double colon (::) operation.
500

What 2 things MUST be included for creating a class?

Data members & Member functions.

500

True or False: Member functions can use outside variables through parameters.

True.

500

What is the purpose of the public interface?

The purpose of the public interface is to modify and access private data in a class. (mutator & accessor)

500

If you wanted to add a number to an existing private data member, what type of function would you use?

A. Mutator functions

B. Accessor functions

C. Const functions

D. Destroyer functions

A. Mutator functions

500

What kind of constructors have no arguments or parameters?

Default constructor

M
e
n
u