Chapter 13

A1:
class Bear class PolarBear Public, a polar bear is a kind of bear
class Kitchen class Home Private, a home has a kitchen
class Person class Programmer Public, a programmer is a kind of person
class Person class HorseAndJockey Private, a horse and jockey team contains a person
class Person, class Automobile class Driver Person public because a driver is a person; Automobile private because a driver has an automobile
A2:
Gloam::Gloam(int g, const char * s) : glip(g), fb(s) { }
Gloam::Gloam(int g, const Frabjous & f) : glip(g), fb(f) { }
// note: the above uses the default Frabjous copy constructor
void Gloam::tell()
{
    fb.tell();
    cout << glip << `\n';
}
A3:
 Gloam::Gloam(int g, const char * s) : glip(g), Frabjous(s) ...

Get The Waite Group's C++ Primer Plus, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.