Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

QUESTION 6 The new classes that we create from existing classes are called ____

ID: 3859765 • Letter: Q

Question

QUESTION 6

The new classes that we create from existing classes are called ____ classes.

sibling

parent

derived

base

1 points   

QUESTION 7

Classes can create new classes from existing classes. This important feature ____.

results in more software complexity

provides public access to the internal state of an object

aids the separation of data and operations

encourages code reuse

1 points   

QUESTION 8

Which of the following is true about inheritance?

All public member functions of the base class become the public member functions of the derived class.

All public members of the base class become the public members of the derived class.

The public member variables of the base class become the public or private member variables of the derived class.

All public member variables of the base class become the public member variables of the derived class.

1 points   

QUESTION 9

The ____ members of an object form its external state.

protected

private

static

public

1 points   

QUESTION 10

Inheritance is an example of a(n) ____ relationship.

handshaking

is-a

has-a

had-a

1 points   

QUESTION 11

Existing classes, from which you create new classes, are called ____ classes.

base

derived

child

sibling

1 points   

QUESTION 12

Consider the following class definitions:

class bClass
{
public:
void setX(int a);
//Postcondition: x = a;
void print() const;

private:
int x;
};

class dClass: public bClass
{
public:
void setXY(int a, int b);
//Postcondition: x = a; y = b;
void print() const;

private:
int y;
};

Which of the following correctly sets the values of x and y?

void dClass::setXY(int a, int b)
{
x = bClass.setX(a);

b = y;

}

void dClass::setXY(int a, int b)
{
x = bClass::setX(a);

y = bClass::setY(b);

}

void dClass::setXY(int a, int b)
{
x = a;

y = b;

}

void dClass::setXY(int a, int b)
{
bClass::setX(a);
y = b;
}

1 points   

QUESTION 13

____ is a “has-a” relationship.

Inheritance

Polymorphism

Encapsulation

Composition

1 points   

QUESTION 14

If the corresponding functions in the base class and the derived class have the same name but different sets of parameters, then this function is ____ in the derived class.

redefined

reused

overridden

overloaded

1 points   

QUESTION 15

Which of the following is a valid definition of the derived class bClass?

class bClass::aClass
{
//...
}

class bClass: public aClass
{
//...
};

class aClass::bClass
{
//...
};

class aClass: public bClass
{
//...
};

1 points   

QUESTION 16

To ____ a public member function of a base class in the derived class, the corresponding function in the derived class must have the same name, number, and types of parameters.

rename

reuse

redefine

overload

1 points   

QUESTION 17

OOP implements ____.

IPE

EIP

UML

OOD

1 points   

QUESTION 18

The ____ members of an object form its internal state.

public

protected

private

static

1 points   

QUESTION 19

Which of the following statements about inheritance is true if memberAccessSpecifier is protected?

The protected members of the base class become private members of the derived class.

The derived class can directly access any member of the base class.

The public members of the base class become protected members of the derived class.

The private members of the base class become protected members of the derived class.

1 points   

QUESTION 20

C++ provides ____ functions as a means to implement polymorphism in an inheritance hierarchy, which allows the run-time selection of appropriate member functions.

overloaded

redefined

virtual

overridden

a.

sibling

b.

parent

c.

derived

d.

base

Explanation / Answer

QUESTION 6

The new classes that we create from existing classes are called ____ classes.

Ans) c.

derived

Reason:In inheritance Already existing classes are called base class or parent class.Developing new classes from existing classes are called child class or derived class.

_____________________

QUESTION 7

Classes can create new classes from existing classes. This important feature ____.

Ans)

d.

encourages code reuse

Reason: By using the concept of inheritance we can avoid code duplication and we can re-use the code in base class.

_____________________

QUESTION 8

Which of the following is true about inheritance?

Ans)

b.

All public members of the base class become the public members of the derived class.

_____________________

QUESTION 9

The ____ members of an object form its external state.

Ans)

d.

public

_____________________

QUESTION 10

Inheritance is an example of a(n) ____ relationship.

Ans)

b.

is-a

_____________________

QUESTION 11

Existing classes, from which you create new classes, are called ____ classes.

Ans)

a.

base

Reason:In inheritance Already existing classes are called base class or parent class.Developing new classes from existing classes are called child class or derived class.

_____________________

QUESTION 12

d)

void dClass::setXY(int a, int b)
{
bClass::setX(a);
y = b;
}

QUESTION 13

____ is a “has-a” relationship.

Ans)

d.

Composition

_____________________

QUESTION 14

If the corresponding functions in the base class and the derived class have the same name but different sets of parameters, then this function is ____ in the derived class.

Ans)

d)overloaded

_____________________

QUESTION 15

Which of the following is a valid definition of the derived class bClass?

Ans)

b.

class bClass: public aClass
{
//...
};

_____________________

QUESTION 16

To ____ a public member function of a base class in the derived class, the corresponding function in the derived class must have the same name, number, and types of parameters.

Ans)

c redefine.

_____________________

QUESTION 17

OOP implements ____.

Ans)

d.

OOD

_____________________

QUESTION 18

The ____ members of an object form its internal state.

Ans)

c.

private

_____________________

QUESTION 19

Which of the following statements about inheritance is true if memberAccessSpecifier is protected?

Ans)

c.

The public members of the base class become protected members of the derived class.

_____________________

QUESTION 20

C++ provides ____ functions as a means to implement polymorphism in an inheritance hierarchy, which allows the run-time selection of appropriate member functions.

Ans)

c.

virtual

_________________Thank You

Ans) c.

derived

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote