Question: This is a simple game for 2 players. One card is dealt to each player, face up . The highest value card wins. If the

This is a simple game for 2 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 users to play all cards
in the deck 26 games.
You will have 2 classes:
1) The Deck class which will create the deck of 52 cards
2) 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 header information for each class. Use these classes and only these functions.
class Deck
Deck()// constructor which creates a deck of 52 cards
Card deal()// deal a card
void display()// show all the cards in the deck
void shuffle()// shuffle the cards in the deck
class Card
Card(char , char )// constructor to create a card, setting the suit and rank
void display()// display the card example: AC,10S, KD
int compare(Card)// return 1 for win, 0 for tie, -1 for lose
-------------------------------------------------------------------------------------------------------------------------------------
When you run your program the following will happen in this order:
1) A new deck will be created.
2) The program will ask for the names of the 2 players.
3) The unshuffled deck will be displayed on the screen.
4) The deck will be shuffled.
5) The shuffled deck will display on the screen.
6)26 games will be played, announcing the winner of each game. Ties are possible as well.
7) After all 26 games are played the program will print the statistics.
Things to consider:
How are you going to shuffle?
You MUST use a vector to store cards in your deck.
Use this command to compile your program:
g++ war.cpp card.cpp deck.cpp -o war
 This is a simple game for 2 players. One card is

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!