Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Program: In this program, the student will program a simulation of deck of cards. The program will do the following: 1. Ask the user to

Program: In this program, the student will program a simulation of deck of cards. The program will do the following: 1. Ask the user to enter the number of decks to shuffle 2. Shuffle a decks of cards. No instance of a card should be repeated more times than the number of decks. Example: If you shuffle 4 decks, the 7 of clubs should appear 4 times (no more no less). 3. Displays all of the cards in the shuffled decks. Displays the cards face values and suit values. NOTE: Heart () can be displayed as H, Club () can be displayed as C, Diamond () can be displayed as D, Spade () can be displayed as S. Your program should contain the following: 1. Symbolic constants for the number of cards per deck (52), number of face values per deck (13), and number of suits per deck (4). 2. Array(s) for shuffled deck of cards (depending on how you accomplish it). 3. Function to shuffle deck of cards. 4. Function to display the deck of cards. 5. All user input and output uses cin and cout (not scanf or printf) Recommendations: If you have one deck of cards, you have 52 cards. You can represent each card to have a numerical value between 0 and 51. You can use rand()%(CARDS_IN_DECK*numberOfDecks) to get a random number and check that with previous numbers drawn. You can then use this unique number to determine the face and suit of the card. BONUS (+5): Instead of H, C, D, and S, displays,,, and instead.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning ASP.NET 2.0 And Databases

Authors: John Kauffman, Bradley Millington

1st Edition

0471781347, 978-0471781349

More Books

Students also viewed these Databases questions