Question: Use C++ Write a program that can deal a deck of cards 1) 4 suits 2) 13 values A, 2-10, J, Q, K 3) Prompt
Write a program that can deal a deck of cards 1) 4 suits 2) 13 values A, 2-10, J, Q, K 3) Prompt for # users (Y) 4) Prompt for # cards/user (X) 5) Deal X cards to Y users, one each, in turn. 20 points for a deck. The deck can be any internal representation you like (vectors, strings, arrays), but when displayed, the user will see it as "A spades", "Q Hearts" or "2 Diamonds". Also, a deck is limited to the 52 possible cards - each deal is not simply a random number between 1 and 52! 20 points for a function to shuffle that deck. Defining a deck of 4 suits/13 values is one thing. Now create a function that when passed a deck, will somehow randomize their positions (think of a "reverse" sort-where instead of looping through the values to put them in increasing/decreasing order, you are purposefully mixing them up). It is possible that the shuffle routine need to be called multiple times to truly "mix them up". 20 points for making the deck into a "class", with at least one constructor method for initializing a new deck, and one to shuffle the cards. 20 points for a game!-Define and implement the rules for any card game you like (black jack, go fish!, crazy eights, war, etc.). Just use the deck and the shuffling routine, then add rules to allow more than one player to take turns. Define what each play is, as well as how to win or lose the game and have the program automatically determine when the game is over and who won or lost
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
