War C Program Classes 1The CardDeck class which will create
War (C++ Program)
Classes:
1)The CardDeck class which will create the deck of cards
2)The Card class which creates cards
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 CardDeck( // constructor which creates a deck of 52 cards
public void displayCardAt(int) // display the card at particular location (array index)
public int deal( ) // deal a card – return the point value of the card
public int cardsLeft( ) // how many cards are left in the deck
public void shuffle( ) // shuffle the cards in the deck
public class Card
public Card (char s, int r ) // constructor to create a card, setting the suit and rank
public int getValue( ) // return the point value of the card. Ace = 1, 2 thru 10, face cards = 10
public void displayCard( ) // display the card
*** Arrays are to be used to implement classes. Not vectors
You will need to provide a menu with the following choices:
1)Get a new card deck
2)Show all cards in the deck
3)Shuffle
4)Play WAR!
5)Exit
Thank you ahead of time.
Solution
#include