Question: I need the following in C++. 1. Specify, design, and implement a class for a card in a deck of playing cards. The object should

I need the following in C++.

1. Specify, design, and implement a class for a card in a deck of playing cards. The object should contain methds for setting and retrieving the suit and rank of a card.

2. Use the card class developed to create a new class for a deck of cards. The deck class has a sequence with a capacity of 52 to hold the cards. The constructor assigns 52 cards in order of suit and rank to the sequence. A friend function should display the entire deck using words (i.e., "the ace of spades").

3. Modify the card and deck classes so that they will be useful in a program to shuffle a deck of cards, deal all the cards to four plaers, and display each player's hand. For the shuffle function, generate a random number k for each card index whose value is from 0 to index. Then define a swap function to exchange the values for card[index] and card[k], using a swap function that you define.

4. Use a cirucular linked list to run a simple simulation of a card game. Use the card and deck classes, and shuffle and deal already created. Create a player class to hold a hand of dealt cards. During each turn, a playerwill discard a card. Use rand() to determine who gets the first turn in each hand, and make sure each person has a turn during every hand. The program ends when all cards have been played.

The program should also include the following in the program:

I need the following in C++. 1. Specify, design, and implement aclass for a card in a deck of playing cards. The object

a) Construct an object oriented approach that implements classes with private data, public constructors (default, parameter, and copy), public accessor and mutator methods for private data, friend functions and overloaded operators as appropriate. Only const accessor methods may be declared inline. Class methods should use passed parameters only when they are not already stored as private data members in the object. Include the following additional (to the textbook) design requirements in your solution: Card class declares and uses enumerated types for suit (clubs, diamonds, hearts, spades) and card rank (two, three, four, five, six, seven, eight, nine, ten, jack, queen, king, ace) Card class overloads

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