Ask Question, Ask an Expert


Ask C/C++ Expert

Home >> C/C++

You will construct two classes that represents an individual poker card and a complete 52 deck of cards. This lab is intended to prepare you for your next homework, so pay attention!

UML Diagram

Below is a UML diagram representing the required classes:

Card Class

We use the card class to represent an individual poker card. This includes:

Suit_t _suit

Suit_t is an enum that contains the four poker suits: Club, Diamond, Heart, Spade.

Rank_t _rank

Rank_t is an enum that contains all possible card ranks, e.g., 2-10, Jack, Queen, King, Ace.


The card class has two constructors: a default constructor that sets the initial value of the card's suit to be Club and rank to be 2. The second constructor accepts a suit and rank as input parameters.


Returns the card's Suit_t value in ENUM form.


Returns the card's Suit_t value in string form. E.g. "Ace" or "Clubs".


Returns the card's Rank_t in ENUM form.


Returns the card's Rank_t value in string form. E.g. "Two", or "Jack".

Deck Class

The deck class will be used to represent a standard 52 card poker deck. This includes:

Card _cards[52]

This is an array of 52 unique cards.

int _used_indices[52]

This variable is used to track previously dealt cards. For ex, assuming that _cards[0] represents the two of clubs, having putting a value of "1" inside _used_indices[0] could indicate that the two of clubs has been dealt and cannot be used again until the deck gets reshuffled.


The Deck's constructor should initialize a fresh deck of 52 unique cards.


Calling this function will "zero out" _used_indices, which results in a fresh deck of cards.


This function will randomly select a card from _deck and return it to the user.

Download:- assign.pdf

C/C++, Programming

  • Category:- C/C++
  • Reference No.:- M914298
  • Price:- $70

Priced at Now at $70, Verified Solution

Have any Question? 

Related Questions in C/C++

Problem 1overview for problem 1a of this assignment you

Problem #1 Overview: For problem 1(a) of this assignment, you will need a C++ compiler. In order to receive credit, your program must compile and run; and you must provide the actual source code file so that I can compil ...

Programming assignment- in this assignment you are

Programming Assignment- In this assignment you are requested to write a C++ program that displays the following colored pyramid on the screen: - The pyramid is 71 characters wide and 21 characters high. - To draw it, you ...

C program assignmentaccording to C Program Assignment According to

C Program Assignment According to, the great circle distance based on two coordinates in nautical miles is given by: d = r * Δσ where r is the radius of the earth and Δσ ...

Computer programming assignment-q1 using for loop write a c

Computer Programming Assignment- Q1. Using for loop, write a C++ program that prints out the multiples of 3 up through 75, separated by a blank space.  3 6 9 12 15 18 21 24 27 30 33 36 39 42 45 48 51 54 57 60 63 66 69 72 ...

This program involves using stl listsfor this program you

This program involves using STL lists. For this program you will implement three functions whose prototypes are given below: list ::iterator mxIter(list ::iterator first, list ::iterator last); void selectSort(list & aLi ...

1 requirementsin this assignment you can unleash your

1. REQUIREMENTS In this assignment, you can unleash your imaginations and use OpenGL with C/C++ programming to produce a scene(s) that represents what you envision could possibly be seen under the sea. Please note that a ...

Only one programwrite a c program to find fibonacci numbers

Only one program Write a C++ Program to Find Fibonacci Numbers using Dynamic Programming.

Discussion questonsplease respond to all of the following

Discussion Questons Please respond to all of the following prompts: • How are input and output accomplished in C++? • How do cin and cout relate to ostream and istream? Lab Activity 1. Write a C++ program per the require ...

1 learner objectivesat the conclusion of this programming

1. Learner Objectives: At the conclusion of this programming assignment, participants should be able to: * Apply repetition structures within an algorithm * Construct while (), for (), or do-while () loops in C * Compose ...

Please use codeblockslist the program and the output on the

Please use codeblocks List the program and the output on the command line Eg #include #include using namespace std; int main() { floatjohno = 0.5; size_t size = 24; vector array(size); for(inti=0; i     { johno = johno + ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

A cola-dispensing machine is set to dispense 9 ounces of

A cola-dispensing machine is set to dispense 9 ounces of cola per cup, with a standard deviation of 1.0 ounce. The manuf

What is marketingbullwhat is marketing think back to your

What is Marketing? • "What is marketing"? Think back to your impressions before you started this class versus how you

Question -your client david smith runs a small it

QUESTION - Your client, David Smith runs a small IT consulting business specialising in computer software and techno

Inspection of a random sample of 22 aircraft showed that 15

Inspection of a random sample of 22 aircraft showed that 15 needed repairs to fix a wiring problem that might compromise

Effective hrmquestionhow can an effective hrm system help

Effective HRM Question How can an effective HRM system help facilitate the achievement of an organization's strate