Exam 15: Inheritance

arrow
  • Select Tags
search iconSearch Question
  • Select Tags

If the member variables in a base class are marked as private,can a derived class directly access those variables?

Free
(Short Answer)
4.8/5
(40)
Correct Answer:
Verified

No

If a base class has a public member function,and the derived class has a member function with the same name,but with a different parameter list,this function is said to be

Free
(Multiple Choice)
4.8/5
(31)
Correct Answer:
Verified

A

What is another name for a child class?

Free
(Multiple Choice)
4.9/5
(40)
Correct Answer:
Verified

D

Give a base class with at least one public member function,how many classes can redefine that member function?

(Multiple Choice)
4.9/5
(36)

Using inheritance allows us to

(Multiple Choice)
4.8/5
(33)

Given the following classes and code,what is the output of the last statement shown? Class Pet { Public: Virtual void print); String name; Private: }; Class Dog: public Pet { Public: Void print); String breed; }; Void Pet::print) { Cout << "My name is " << name; } Void Dog::print) { Pet::print); Cout << ",and my breed is a "<< breed << endl; } Pet pPtr; Dog dPtr; DPtr->name= "Rover"; DPtr->breed="Weiner"; PPtr= dPtr; PPtr->print);

(Multiple Choice)
4.8/5
(38)

The copy constructor from the base class is not inherited into the derived class.

(True/False)
4.9/5
(41)

Destructors are not inherited into the derived class.

(True/False)
4.8/5
(47)

The ability to associate multiple meanings to one function name using dynamic binding is called _________.

(Short Answer)
4.7/5
(36)

C++ implements polymorphism by waiting until run-time to determine which version of a function to use.This is also known as ______________.

(Short Answer)
4.8/5
(41)

If you have a copy constructor in the base class,but do not have a copy constructor for the derived class,then

(Multiple Choice)
4.9/5
(49)

The base class has everything that is in the derived class and more

(True/False)
4.9/5
(33)

If a base class has declared a function to be a virtual function,then does the derived class need to include the word virtual also?

(Short Answer)
4.8/5
(44)

A constructor of the base class is ____ inherited in the derived class is/is not)

(Short Answer)
4.8/5
(38)

If you define a function in the derived class that has the same function signature as a function in the base class,this is known as

(Multiple Choice)
4.9/5
(42)

Which of the following are true?

(Multiple Choice)
4.7/5
(39)

A derived class automatically gets all the member variables from the base class.

(True/False)
5.0/5
(39)

If the member variables of the base class are marked as protected,who can access those variables?

(Essay)
4.9/5
(39)

The ifstream class is derived from the __________ class.

(Short Answer)
4.9/5
(37)

In order to tell the compiler to wait to decide which version of a function to use,you must precede the function declaration in the base class with the keyword

(Multiple Choice)
4.8/5
(36)
Showing 1 - 20 of 53
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)