Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ 1) Playing Card Class In this problem, you will implement a DeckofCards cdlass that simulates a deck of playing cards The class will utilize

C++ image text in transcribed
1) Playing Card Class In this problem, you will implement a DeckofCards cdlass that simulates a deck of playing cards The class will utilize an important algorithm to "shuffle" the simulated card deck Part 1: Create an object class named DeckofCards that models a randomized deck of playing cards. Individual "cards" will be represented by integer values as follows: 0 1 2 3 45 6789 10 11 12 13 14 15 16 A 2 3456789 10JQKA2 34- . 51 Where the value 0 represents the Ace of the "first suit, 1 is the 2 of the first suit, 13 is the Ace of the "second" suit, and so on. The actual "suit" of the card will not be needed for now and can be ignored. Also note that in this problem we start counting with 0, rather than with 1 The DeckOfCards class should include the following private data members A 52 element integer array to represent the shuffled deck of cards An integer index to maintain the "next card" to be dealt from the deck The DeckOfCards class must also provide the following public (member) functions: A default constructor that will initialize the values of the card deck array with integer values 0.. 51, and then "shuffle the card deck (see description below) deck. If no cards remain, then the deck should be reshuffled (and reset) values in the card "deck using the Knuth Shuffle algorithm Given an array a with A member function dealCard) that will return the "next card value from the shuffled A member function shuffle () that takes no arguments and shuffiles (randomizes) the elements, the Knuth Shuffle algorithm is as follows FORi n-1 TO 1 REPEAT the following two lines: a pseudo-random integer from the interval 0

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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2018 Dublin Ireland September 10 14 2018 Proceedings Part 1 Lnai 11051

Authors: Michele Berlingerio ,Francesco Bonchi ,Thomas Gartner ,Neil Hurley ,Georgiana Ifrim

1st Edition

3030109240, 978-3030109240

More Books

Students also viewed these Databases questions

Question

Did the team members feel that their work mattered

Answered: 1 week ago

Question

2. What process will you put in place to address conflicts?

Answered: 1 week ago