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 theBadDude
class that defines its member functions- Child of both the
Gunslinger
and thePokerPlayer
classes
- Child of both the
BadDude.cpp
: The .cpp file for theBadDude
class that contains the bodies of the defined member functionsGunslinger.h
: The .h file for theGunslinger
class that defines its member functions- Child of the
Person
class
- Child of the
Gunslinger.cpp
: The .cpp file for theGunslinger
class that contains the bodies of the defined member functionsPerson.h
: The .h file for thePerson
class that defines its member functions- Parent for the
Gunslinger
andPokerPlayer
classes
- Parent for the
Person.cpp
: The .cpp file for thePerson
class that contains the bodies of the defined member functionsPokerPlayer.h
: The .h file for thePokerPlayer
class that defines its member functions- Child of the
Person
class
- Child of the
PokerPlayer.cpp
: The .cpp file for thePokerPlayer
class that contains the bodies of the defined member functions
The output for the current version of this program can be seen below: