Question: War (C++ Program). (Don't just copy and paste. I need the functions to be exactly like the one provided below on the classes. ) Note:
War (C++ Program). (Don't just copy and paste. I need the functions to be exactly like the one provided below on the classes. )
Note: This program will also need to display the actual cards just like the sample below.
Classes:
1)The Deck class which will create the deck of cards Deck.h , Deck.cpp
2)The Card class which creates cards Card.h , Card.cpp
The main logic of the program will be in the main class. You will use the Card class and the CardDeck class to play the game.
Here the methods you will need to build. Feel free to add more if you need them.
public class CardDeck
public Deck( // constructor which creates a deck of 52 cards
public void resetDeck // resets the deck so it looks like a new deck.
public Card deal( ) // deal a card
public int cardsLeft( ) // return the number of cards left in the deck.
public void shuffle( ) // shuffle the cards in the deck
public displayDeck// show all the cards in the deck.
public class Card
public Card(); // Creates a blank card.
public Card (char s, char r ) // constructor to create a card, setting the suit and rank
public void setCard(char s, char r); // a method to set an existing blank card to a particular value
public int getValue( ) // return the point value of the card. Ace = 1, 2 thru 10, face cards = 10
public void displayCard( ) // method to display the card
Sample output.

You will need to provide a menu with the following choices:
1)Get a new card deck
2)Show all the cards that reamin in the deck
3)Shuffle
4)Play WAR!
5)Exit
There are 52 cards in the deck. . . .dealing. . . . One for you. . . Two ofDiamonds [2 2] One for me... Ace of Hearts You Win!!!! Wanna play again? (yes There are 50 cards in the deck. . . .dealing. . . . One for you. . . Queen of Spades
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
