csci 20 :: book learning challenge 14 (due tues, may 3)
Submitting your work: Complete this exercise on your own.

Fill in all of the "Answer" boxes, then print the answer grid that you see after you press "Prepare for printing".

Staple all pages together and submit to the instructor on the date listed above.

Questions:

Download this code when answering the questions on today's challenge.

READ: C++ Inheritance, Understanding Initialization Lists in C++, A pitfall with initialization lists in C++, then answer the following:

Your name:
  1. Define inheritance in the context of object-oriented programming. What is a base class, what is a derived class, and what does the derived class inherit from the base class?
    Answer:
  2. Is an inheritance relationship desribed best as (1) HAS-A or (2) IS-A?
    Answer:
  3. Can a derived class directly access the private members of its base class? Does a derived class inherit the private members of its base class? Provide details as needed.
    Answer:
  4. Refer to today's sample code. What is the base class, and what are the derived classes?
    Answer:
  5. Refer to today's sample code. When a Player object is created, is the constructor for GameObject executed?
    Answer:
  6. Refer to today's sample code. When a Player object is created, a Game Object is also created. In what order are the two "layers" (Player and GameObject) of the Player object created?
    Answer:
  7. Refer to today's sample code. What mechanism does C++ provide that allows you to create a Player object and pass an argument to the base class (GameObject) overloaded constructor?
    Answer:
  8. Refer to today's sample code. Which constructors in the GameObject, Player, and Item classes use initialization lists?
    Answer:
  9. When you use an initialization list in a constructor to initialize the data members of a class, do you need to repeat these initializations in the body of the constructor?
    Answer:
  10. What is important to remember in terms of (1) the order that the data members of a class are declared and (2) the order that data members are initialized using an initialization list?
    Answer:

Total points for this book learning challenge:

150 points