Exam 15: Inheritance

arrow
  • Select Tags
search iconSearch Question
  • Select Tags

You should make a function a virtual function if

(Multiple Choice)
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.8/5
(39)

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

(Short Answer)
4.9/5
(45)

The constructor for a class is inherited.

(True/False)
4.9/5
(38)

All member functions in a base class should be listed as virtual functions.

(True/False)
4.7/5
(32)

Which of the following would correctly call the base class BaseClass) assignment operator from the derived class DerivedClass) assignment operator? DerivedClass& DerivedClass::operator =const DerivedClass& rightSide) { //what goes here? }

(Multiple Choice)
4.8/5
(48)

The derived class may define variables and member functions other than those that are in the base class.

(True/False)
4.8/5
(40)

A base class pointer variable can point to

(Short Answer)
4.8/5
(45)

When deriving a class, you should

(Multiple Choice)
4.9/5
(40)

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

(Multiple Choice)
4.8/5
(33)

Which is the correct way to tell the compiler that the class being declared ChildClass) is derived from the base class BaseClass)?

(Multiple Choice)
4.9/5
(37)

The assignment operator is inherited from the base class.

(True/False)
4.9/5
(43)

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
(39)

The ifstream class is derived from the __________ class.

(Short Answer)
4.7/5
(46)

When the derived class gets all the member variables from the base class, we say that they are _________ from the base class.

(Short Answer)
4.9/5
(31)

If two functions in the same scope) have the same name, but a different function signature, this means that the functions are __________.

(Short Answer)
4.8/5
(33)

Given the following simplified classes, Class Pet { Public: Virtual void print); String name; Private: }; Class Dog: public Pet { Public: Void print); String breed; }; Dog vDog; Pet vPet; VDog.name="rover"; VDog.breed = "Collie"; Which of the following statements are not legal?

(Multiple Choice)
4.8/5
(33)

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

(True/False)
4.9/5
(41)

If you have the following class definitions, which of the following is the proper way to construct an object of the derived class? Class Pet { Public: Pet); Void printPet); String getName); Void setNamestring newName); Private: String name; }; Class Dog:public Pet { Public: Dog); Void printPet); Void setTypestring newType); String getType); Private: String type; };

(Multiple Choice)
4.8/5
(43)

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

(Short Answer)
4.9/5
(39)
Showing 21 - 40 of 53
close modal

Filters

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