How many sections does a class definition have?
2
What does encapsulation mean?
Some parts of an object are hidden from the outside, and you control access to them through a public interface.
What are member functions?
Functions that are part of a class and only use data members of that class.
What is the main purpose of a constructor in C++?
To initialize an object.
Who is the best C++ teacher?
Ms. Bellofatto
What is a class in simple terms?
A class is like a blueprint from which objects can be made.
What are the two main types of member functions?
Mutators and accessors
Where are member functions declared?
In the public section.
Where are constructors declared?
In the class definition.
(T or F) A mutator function should always return a value.
False
Where do you specify data members in a class?
In the class definition
What does a public function do?
Allows safe access to modify or retrieve a private attribute.
When defining an accessor member function, what do you use after the parameter parentheses?
Const
A constructor is a special member function that ____________ the data members of an object.
Defines
(T or F) When we specify the member functions, we specify the behavior of the objects.
True
What is an object in simple terms?
An object is a specific instance of a class.
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.
What are implicit parameters?
Refers to the object on which an instance method is called.
How many constructors can a class have?
Unlimited
Give an example of encapsulation.
Varies
Ex. Not knowing how brakes work on your car.
What notation do member functions use?
Dot notation
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.
What are explicit parameters?
Parameters listed in the method’s definition and passed directly by the caller (argument).
What constructor is called when the object is defined without any parameters?
Default
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."