1 Introduction To Computers And Programming 2 Introduction To C++ 3 Expressions And Lnteractivity 4 Making Decisions 5 Loops And Files 6 Functions 7 Arrays 8 Searching And Sorting Arrays 9 Pointers 10 Characters, C-strings, And More About The String Class 11 Structured Data 12 Advanced File Operations 13 Introduction To Classes 14 More About Classes 15 Inheritance, Polymorphism, And Virtual Functions 16 Exceptions, Templates And The Standard Template Library (stl) 17 Linked Lists 18 Stacks And Queues 19 Recursion 20 Binary Trees expand_more
15.1 What Is Inheritance? 15.2 Protected Members And Class Access 15.3 Constructors And Destructors In Base And Derived Classes 15.4 Redefining Base Class Functions 15.5 Class Hierarchies 15.6 Polymorphism And Virtual Member Functions 15.7 Abstract Base Classes And Pure Virtual Functions 15.8 Multiple Inheritance Chapter Questions expand_more
Problem 1RQE: What is an is a relationship? Problem 2RQE: A program uses two classes: Dog and Poodle. Which class is the base class, and which is the derived... Problem 3RQE: How does base class access specification differ from class member access specification? Problem 4RQE: What is the difference between a protected class member and a private class member? Problem 5RQE: Can a derived class ever directly access the private members of its base class? Problem 6RQE: Which constructor is called first, that of the derived class or the base class? Problem 7RQE: What is the difference between redefining a base class function and overriding a base class... Problem 8RQE Problem 9RQE: What is an abstract base class? Problem 10RQE: A program has a class Potato, which is derived from the class Vegetable, which is derived from the... Problem 11RQE: What base class is named in the line below?class Pet : public Dog Problem 12RQE: What derived class is named in the line below? class Pet : public Dog Problem 13RQE: What is the class access specification of the base class named below? class Pet : public Dog Problem 14RQE: What is the class access specification of the base class named below? class Pet : Fish Problem 15RQE: Protected members of a base class are like __________ members, except they may be accessed by... Problem 16RQE: Complete the table on the next page by filling in private, protected, public, or inaccessible in the... Problem 17RQE: Complete the table below by filling in private, protected, public, or inaccessible in the right-hand... Problem 18RQE: Complete the table below by filling in private, protected, public, or inaccessible in the right-hand... Problem 19RQE: A derived class inherits the ________ of its base class. Problem 20RQE: When both a base class and a derived class have constructors, the base classs constructor is called... Problem 22RQE: An overridden base class function may be called by a function in a derived class by using the... Problem 23RQE: When a derived class redefines a function in a base class, which version of the function do objects... Problem 24RQE: A(n) __________ member function in a base class expects to be overridden in a derived class. Problem 25RQE: ________ binding is when the compiler binds member function calls at compile time. Problem 26RQE: __________ binding is when a function call is bound at runtime. Problem 27RQE: _________ is when member functions in a class hierarchy behave differently, depending upon which... Problem 28RQE: When a pointer to a base class is made to point to a derived class, the pointer ignores any _______... Problem 29RQE: A(n) __________ class cannot be instantiated. Problem 30RQE: A(n) _______ function has no body, or definition, in the class in which it is declared. Problem 31RQE: A(n) _________ of inheritance is where one class is derived from a second class, which in turn is... Problem 32RQE: _______ is where a derived class has two or more base classes. Problem 33RQE: In multiple inheritance, the derived class should always __________ a function that has the same... Problem 34RQE: Write the first line of the declaration for a Poodle class. The class should be derived from the Dog... Problem 35RQE: Write the first line of the declaration for a SoundSystem class. Use multiple inheritance to base... Problem 36RQE: Suppose a class named Tiger is derived from both the Fel is class and the Carnivore class. Here is... Problem 37RQE: Write the declaration for class B. The classs members should be as follows: m: an integer. This... Problem 38RQE: T F The base classs access specification affects the way base class member functions may access base... Problem 39RQE: T F The base classs access specification affects the way the derived class inherits members of the... Problem 40RQE: T F Private members of a private base class become inaccessible to the derived class. Problem 41RQE: T F Public members of a private base class become private members of the derived class. Problem 42RQE: T F Protected members of a private base class become public members of the derived class. Problem 43RQE: T F Public members of a protected base class become private members of the derived class. Problem 44RQE: T F Private members of a protected base class become inaccessible to the derived class. Problem 45RQE: T F Protected members of a public base class become public members of the derived class. Problem 46RQE: T F The base class constructor is called after the derived class constructor. Problem 47RQE: T F The base class destructor is called after the derived class destructor. Problem 48RQE: T F It isnt possible for a base class to have more than one constructor. Problem 49RQE: T F Arguments are passed to the base class constructor by the derived class constructor. Problem 50RQE: T F A member function of a derived class may not have the same name as a member function of the base... Problem 51RQE Problem 52RQE: T F A base class may not be derived from another class. Problem 53RQE: class Car, public Vehicle { public: Car(); Car(); protected: int passengers; } Problem 54RQE: class Truck, public : Vehicle, protected { private: double cargoWeight; public: Truck(); Truck(); }; Problem 55RQE: class SnowMobile : Vehicle { protected: int horsePower; double weight; public: SnowMobile(int h,... Problem 56RQE: class Table : public Furniture { protected: int numSeats; public: Table(int n) : Furniture(numSeats)... Problem 57RQE: class Tank : public Cylinder { private: int fuelType; double gallons; public: Tank(); Tank(); void... Problem 58RQE: class Three : public Two : public One { protected: int x; public: Three(int a, int b, int c),... Problem 1PC: Employee and ProductionWorker Classes Design a class named Employee. The class should keep the... Problem 2PC: ShiftSupervisor Class In a particular factory, a shift supervisor is a salaried employee who... Problem 3PC: TeamLeader Class In a particular factory, a team leader is an hourly paid production worker who... Problem 4PC Problem 5PC: Time Clock Design a class named TimeClock. The class should be derived from the Mil Time class you... Problem 6PC: Essay Class Design an Essay class that is derived from the GradedActivity class presented in this... Problem 7PC: PersonData and CustoraerData Classes Design a class named PersonData with the following member... Problem 8PC: PreferredCustomer Class A retail store has a preferred customer plan where customers may earn... Problem 9PC: File Filter A file filter reads an input file, transforms it in some way, and writes the results to... Problem 10PC: File Double-Spacer Create a derived class of the abstract filter class of Programming Challenge 9... Problem 11PC: Course Grades In a course, a teacher gives the following tests and assignments: A lab activity that... Problem 12PC: Ship. CruiseShip, and CargoShip Classes Design a Ship class that has the following members: A... Problem 13PC: Pure Abstract Base Class Project Define a pure abstract base class called BasicShape. The BasicShape... Problem 14PC format_list_bulleted