Using the Adapter examples found in this chapter, create a program as follows: 1. Implement a Citizen
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 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 Answer: