CpSc 246 Inheritance Assignment
Spring 2023


50 points

Some political scientists are interested in examining the gender, race, sexual orientation, nationality, and religion of people. The administrators have incomplete lists of each demographic that is being tracked. Thus, before analysis can begin, the administrators want to update the demographics. (You will need to use vectors since they are dynamic).
You are to write a program that permits administrators to update demographic classifications and then creates a histogram of the demographics of a population.
The political scientists want to examine these characteristics:

When the program starts, it is to begin in administrator mode and permit data to be added to any/all of the above characteristics in any order. Thus user should be able to add to a characteristic multiple times After the administrator is done, the software is to start normal input mode which permits different population groups to be analyzed.

Your assignment must use inheritance. Create a base demographic class, each of the demographics will be derived classes. The base class would include the demographic name, number of characteristics in the demographic, and if you wish, a demographic numeric id so that you do not have to constantly compare strings.
Each derived class will include a vector of the characteristics currently defined. The derived class must include sets and gets as appropriate.


Initially, use the following ("hard code" this data in your program in the constructor of the appropriate derived class) When the administrator is "done", the program should start data collection mode.
Use the following KEYBOARD input to test your code:

Histogram format must visually show the relative differences. For example:
Gender
    male:     * * * *
    female:  * * * * *
    asexual: * * *

Submit your code, sample run, and user directions to the Demographic dropbox