Master file for C++ Midterm exam. The exam asked us to define four different classes, Person, Gunslinger, PokerPlayer, and BadDude. Gunslinger and PokerPlayer are both child classes of Person, while BadDude is a child class of both Gunslinger and PokerPlayer. The exam specifically required that the firstName and lastName variable be initialized as char pointers, rather than strings, which is why that portion of the program is sub-optimal. We were also required to use dynamic memory allocation and overloaded assignment operators. Furthermore, several methods were specifically requested as part of the separate classes.
I have intentionally avoided copy/pasting the midterm wording to make this less likely to appear in search engine results for future students.
This was written for the midterm for CSCI222: C++/Object-Oriented Programming.
Midterm.cpp: Holds the main() function for the programBadDude.h: The .h file for theBadDudeclass that defines its member functions- Child of both the
Gunslingerand thePokerPlayerclasses
- Child of both the
BadDude.cpp: The .cpp file for theBadDudeclass that contains the bodies of the defined member functionsGunslinger.h: The .h file for theGunslingerclass that defines its member functions- Child of the
Personclass
- Child of the
Gunslinger.cpp: The .cpp file for theGunslingerclass that contains the bodies of the defined member functionsPerson.h: The .h file for thePersonclass that defines its member functions- Parent for the
GunslingerandPokerPlayerclasses
- Parent for the
Person.cpp: The .cpp file for thePersonclass that contains the bodies of the defined member functionsPokerPlayer.h: The .h file for thePokerPlayerclass that defines its member functions- Child of the
Personclass
- Child of the
PokerPlayer.cpp: The .cpp file for thePokerPlayerclass that contains the bodies of the defined member functions
The output for the current version of this program can be seen below:
