Your instructor will assign you one of the problems below. To solve your problem, write a program that reads the necessary information to compute and output the indicated values, as efficiently as possible. Following the pattern in the lab exercise, first, design using OCD; then code your design in C++ using stepwise translation; finally, test your program thoroughly.
Project #12.1: Extend yourGenderenumeration with these operations:Write a driver program that tests your functions.
Next(Gender value);that returns the enumerator that followsvalue, wrapping around from the last valid enumerator to the first valid enumerator---returnsFEMALEwhenvalueisUNKNOWN, returnsMALEwhenvalueisFEMALE, and returnsUNKNOWNwhenvalueisMALE.Previous(Gender value);that returns the enumerator that precedesvalue, wrapping around from the first valid enumerator to the last valid enumerator---i.e., returnsFEMALEwhenvalueisMALE, returnsMALEwhenvalueisUNKNOWN, and returnsUNKNOWNwhenvalueisFEMALE.
Project #12.2: Build aMonthenumeration. Using it, create aDateclass that stores the month, day, and year for a date. Test your class by writing a program that reads two dates, and returns the number of days between those two dates (don't forget to consider leap years).
Project #12.3: Extend the classes inenumGenerator.cppto automatically generate theNext()andPrevious()functions described in the previous project for any enumeration.
Project #12.4: Build two enumerations:
- Suit, containing the values Clubs, Diamonds, Hearts and Spades.
- Rank, containing the values Ace, Two, Three, Four, Five, Six, Seven, Eight, Nine, Ten, Jack, Queen, King.
Use these enumerations to design and build a
PlayingCardclass. Using this class andvector, build aDeckOfCardsclass. Provide the following operations:Use these classes to write a program that plays a simple card game, such as "Go Fish."
- A constructor that creates a new (in-order) deck of cards.
- A
Shuffle()operation that arranges thePlayingCards in aDeckOfCardsin random order.- A
TopCard()operation that returns the top card in theDeckOfCards()without removing it.- A
DealTopCard()operation that returns the top card in theDeckOfCards()and removes it.
Turn the following things: