Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Use C++ image text in transcribed
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

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_2

Step: 3

blur-text-image_3

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

Spomenik Monument Database

Authors: Donald Niebyl, FUEL, Damon Murray, Stephen Sorrell

1st Edition

0995745536, 978-0995745537

More Books

Students also viewed these Databases questions