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 1 you are tasked to write a program that outputs

PROBLEM 1 You are tasked to write a program that outputs the following amplifier system specifications: Voltage amplification: 25 Input voltage: 50 mV Power output: 2.5 W Bandwidth: 15 kHz Type: Class A a. For this progr ...

A write an array implementation of self-adjusting lists in

a. Write an array implementation of self-adjusting lists. In a self-adjusting list, all insertions are performed at the front. A self-adjusting list adds a find operation, and when an element is accessed by a find, it is ...

Write a program that calculates mileage reimbursement for a

Write a program that calculates mileage reimbursement for a salesperson at a rate of $0.35 per mile. Your program should interact with the user in this manner: MILEAGE REIMBURSEMENT CALCULATOR Enter beginning odometer re ...


Write a C++ program that will use loops to perform each of the following tasks: 1. Ask the user for two characters from the keyboard and read them into char variables. Determine which input is larger and which is smaller ...

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 ...

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 ...

Question 1you are facing the following problem you are

Question 1 You are facing the following problem: You are given a robot and your task is to "guide" the robot through a 2-dimensional maze such that the robot can reach a desired goal state. Assume that the maze is define ...

1 write a program to find the sum amp average of the given

1) Write a program to find the sum & average of the given numbers using the while loop. 2) Write a program in C to find the sum and average of the given numbers stored in an array of n values.

Only one programwrite a c program to find fibonacci numbers

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

  • 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