Question: Using the Adapter examples found in this chapter, create a program as follows: 1. Implement a Citizen Data Base that stores various types of Humanoid

Using the Adapter examples found in this chapter, create a program as follows:

1. Implement a Citizen Data Base that stores various types of Humanoid instances (Orkan, Romulan, Earthling, and perhaps Martian). Decide whether you will use the private base class Adapter-Adaptee relationship or the association relationship between the Adapter and Adaptee (hint: the private inheritance version will be easier).

2. Noting that the Citizen Data Base handles Person instances, can this class be used as-is to store various types of Humanoid instances, or must it be adapted in some way? Recall thatPerson is a base class of Humanoid (if you chose this implementation), but also remember that we can never upcast past a non-public inheritance boundary.

Step by Step Solution

3.39 Rating (158 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related A Practical In Depth Guide C++ Questions!