Question: please using c + + and srand to random shuffle. This assignment will use a Card class to build a Deck class. Then you will

please using c++ and srand to random shuffle.
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 2 players. One card is dealt to each player, face
up. The highest value card wins. If the cards are the same, then it's 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:
The Deck class which will create the deck of 52 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. Also you must use an
array to store the cards in the deck - you are not allowed to use a vector.
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 print()// 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
Card()// default Card needed for array
void print()// 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:
A new deck will be created.
The program will ask for the names of the 2 players.
The unshuffled deck will be displayed on the screen using the print()
function.
The deck will be shuffled.
The shuffled deck will display on the screen.
26 games will be played, announcing the winner of each game. Ties
are possible as well.
After all 26 games are played the program will print the statistics.
Things to consider:
How are you going to shuffle?
You MUST use an array to store cards in your deck.
Use this command to compile your program:
g++ war. cpp card.cpp deck.cpp -o war
What to submit:
Submit 5 source files: main.cpp, Deck.h, Deck.cpp, Card.h, Card.cpp
2 screenshots:
The first part of the program just before the 2 names are
accepted. This will show the unshuffled and the shuffled deck
as well as the 2 names
The final screen showing the statistics.
many expert did wrong please help
please using c + + and srand to random shuffle.

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 Programming Questions!