GoConqr has a new look! Let us know what you think.

Quiz

ch12

mnahvi7+examtime 19 questions

Take the quiz

Questions in this quiz (19)

  1. 1Select the false statement regarding inheritance.
    1. ASome derived classes can have multiple base classes.
    2. BBase classes are usually more specific than derived classes.
    3. CA derived class can be the base class for other derived classes.
    4. DA derived class can contain more attributes and behaviors than its base class.
  2. 2Which of the following is not a kind of inheritance in C++?
    1. Aprotected.
    2. Bstatic.
    3. Cprivate.
    4. Dpublic.
  3. 3The is-a relationship represents.
    1. AInformation Hiding.
    2. BA friend.
    3. CComposition.
    4. DInheritance.
  4. 4 Which of the following is most likely a base class of the other three?
    1. Aautomobile.
    2. BminiVan.
    3. Cconvertible.
    4. Dsedan.
  5. 5Which of the following is not a good example of a hierarchy that could be modeled by inheritance?
    1. AAirplanes.
    2. BGeometric shapes.
    3. CPrime numbers.
    4. DAnimals.
  6. 6To declare class subClass a privately derived class of superClass one would write:
    1. Aclass subclass : private superClass.
    2. Bclass subclass < private superClass >.
    3. Cclass subclass inherits private superClass.
    4. Dclass subclass :: private superClass.
  7. 7From most restrictive to least restrictive, the access modifiers are:
    1. Aprotected, public, private.
    2. Bprotected, private, public
    3. Cprivate, public, protected.
    4. Dprivate, protected, public.
  8. 8Protected base class members cannot be accessed by:
    1. Afriends of derived classes.
    2. BFunctions that are not derived-class member functions.
    3. CFunctions that are neither friends of the base class, derived-class member functions nor friends of a derived class
    4. Dfriends of the base class.
  9. 9Assuming the definition,

    class Circle : public Point

    which of the following is false?
    1. AThe keyword public indicates the type of inheritance.
    2. BAll the public and protected members of class Circle are inherited as public and protected members, respectively, into class Point.
    3. CThe colon ( : ) in the header of the class definition indicates inheritance.
    4. DPoint is the base class and Circle is the derived class.
  10. 10Assuming the following is the beginning of the constructor definition for class Circle which inherits from class Point,
    Circle::Circle( double r, int a, int b )
    : Point( a, b )
    The second line:
    1. AInvokes the Point constructor with values a and b.
    2. BIs unnecessary because the Point constructor is called automatically.
    3. CCauses a compiler error.
    4. DIndicates inheritance.

Information

Description
Quiz on ch12, created by mnahvi7+examtime on 14/04/2016.
Language
English
Views
2
Rating
No ratings yet
Rate this quiz
Rate this quiz

Feedback

What is it about?

What do you think of the new look?

How do you like it?