Simple Classes
Public Interface
Member Functions
Constructors
Misc.
100

How many sections does a class definition have?

2

100

What does encapsulation mean?

Some parts of an object are hidden from the outside, and you control access to them through a public interface.

100

What are member functions?

Functions that are part of a class and only use data members of that class.

100

What is the main purpose of a constructor in C++?

To initialize an object.

100

Who is the best C++ teacher?

Ms. Bellofatto

200

What is a class in simple terms?

A class is like a blueprint from which objects can be made.

200

What are the two main types of member functions?

Mutators and accessors

200

Where are member functions declared?

In the public section.

200

Where are constructors declared?

In the class definition.

200

(T or F) A mutator function should always return a value.

False

300

Where do you specify data members in a class?

In the class definition

300

What does a public function do?

Allows safe access to modify or retrieve a private attribute.

300

When defining an accessor member function, what do you use after the parameter parentheses?

Const

300

A constructor is a special member function that ____________ the data members of an object.

Defines

300

(T or F) When we specify the member functions, we specify the behavior of the objects.

True

400

What is an object in simple terms?

 An object is a specific instance of a class.

400

Why is it important to keep data members private and use public accessor and mutator functions instead?

So people cannot find your information and directly modify it without going through the public interface.

400

What are implicit parameters?

Refers to the object on which an instance method is called.

400

How many constructors can a class have?

Unlimited

400

Give an example of encapsulation.

Varies

Ex. Not knowing how brakes work on your car.

500

What notation do member functions use?

Dot notation

500

What are the purposes of mutators and accessors?

Mutator functions modify data/change the object that they operate on. Accessors don’t change the object in any way.

500

What are explicit parameters?

Parameters listed in the method’s definition and passed directly by the caller (argument).

500

What constructor is called when the object is defined without any parameters?

Default

500

What is the purpose of object-oriented programming?

Organize and structure code in a way that makes it easier to maintain by modeling real-world entities as "objects."