Question: This assignment will use a Card class to build a Deck class. Then you will use the Deck class to play a card game called
This assignment will use a Card class to build a Deck class. Then you will use the Deck class to play a card game called One Card WAR.This is a simple game for players. One card is dealt to each player, face up The highest value card wins. If the cards are the same, then its a tie. Announce the winner Game over. You will allow the user to select how many games to play. If the number of requested games is greater that the number of cards in the deck, your Deck class will raise an exception and the main function will catch and resolve the exception. The exception will be raised in the deal function. Also this program will be in a single file there will not be separate header and cpp files for the classes. Also you will use a vector to store your cards in the Deck class DO NOT use an array to store the Cards in the Deck. You will have classes: The Deck class which will create the deck of cards The Card class which creates cards The main logic of the game will be in the main program. You will use the Card class and the Deck class to play the game. Here are the class descriptions for each class. Use these classes and only these functions. class DeckDeck constructor which creates a deck of cardsCard deal deal a card if you can otherwise raise an exceptionvoid print show all the cards in the deckvoid shuffle shuffle the cards in the deckbool isEmpty return true if deck is emptyclass Card notice there is NOT a default card constructorCardchar char constructor to create a card, setting the suit and rankvoid print display the card example: ACS KDint compareCard return for win, for tie, for lose
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
