constructors
syntax
data members
random
member functions
100

declare a default constructor named Cat

Cat();

100

can classes have paramiters?

no

100

data members are declared in _____ part of the class

public

100
name a example of a class

varies

100

when defining a member function, what symbol is used to show that the member function belongs to the class

::

200

true or false: constructors have the same name as the class

True

200

This keyword specifies that members of a class are accessible from outside the class.

public

200

What are data members?

Variables that hold data specific to each object of the class.

200

what are two commonly used examples of objects in C++

cin, cout

200

true or false: you define a member function in the class under public

false; you declare a member function in the class under public

300

this type of constructor initializes member variables with default values

default constructors

300

this keyword specifies that no change will be made to existing variables

 const

300

True or false: you can initialize a data member in the private section

True

300

what is the difference between setters and mutators

mutators change values and setters set values

300

where do you declare a member function?

in the class, under public

400

what is the difference between a default constructer and a parametrized constructer

default constructer have no perimeter and don't set values whilst parametrized constructer do

400

The process of providing a public interface while hiding the implementation details is called ____

encapsulation

400

declare a data member that is named salary

double salary;

or

int salary

400

How do you ensure that data members of a class are initialized with specific values when an object is created?

by using a constructor

400

what is the difference between getters and setters?

getters output information back to user. setters do not output information back to user but instead update the value of data members

500

what is wrong with with this statement: you define constructers with the rest of the member functions

constructers arent defined, they are declared

500

true or false: is this class correctly defined, if false state error:

class Student()

{

public:

void eat();

void sleep();

void study();

void procrastinate();

private 

string school;

string grade;

string name;

}

false, ending bracket missing a semicolon

500

whats makes data member variables different from regular variables

their scopes are different

500

why use a class instead of a structure?

classes provide better encapsulation and support for more complex systems with constructors

500

define a already declared member function named get_income belonging to the class "Job".(assume there is a already declared data member named income )

void Job::get_income(double income)

{

return income;

}

M
e
n
u