What is a Class?
True or False: Member functions should be private.
False.
What is a mutator?
A mutator is a type of function used to modify private data members.
Where do you declare a member function?
In the public interface.
Why don't constructors have a return type?
They don't return anything.
What is a specific instance of a class?
An object
What are behaviors of an object?
Behaviors are what the object does: how it acts.
A function that does NOT modify any member variables should be marked as _______.
const
Where should member functions be implemented? Which syntax operator must be used?
Should be implemented outside the class definition using the double colon (::) operator.
What does a constructor initialize?
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
How do you initialize an object?
Class name followed by Object name. (Example: for class name Counter, object name score, initialize by Counter score;)
Should a mutator function always return a value?
True or False: Member functions can have the same parameter names as private data members.
False.
The name of a constructor is _____ as its class name.
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.
How would you invoke member functions?
Using the dot notation (.)
Ex: object.function_name()
What syntax MUST be included when invoking member functions?
dot notation (.)
function.action();
What 2 things do member functions use for values?
What syntax operation should be used to declare constructors?
What 2 things MUST be included for creating a class?
Data members & Member functions.
True or False: Member functions can use outside variables through parameters.
True.
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)
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
What kind of constructors have no arguments or parameters?
Default constructor