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

Assignmentbullwrite the code for each lab

Assignment • Write the code for each lab assignment. • Submit the lab in a single zip file in the online course shell. The lab must contain all .cpp files, along with any additional files that may be necessary for your p ...

Assignmentgoals developing problem-solving skills declaring

Assignment Goals: Developing problem-solving skills, declaring variables, multi-way branches, data validation. Problem: Complete Programming Challenge 4.19 in your text book. Do not accept values larger than 10 meters or ...

Assignmentinstructionsthis assignment is to implement your

Assignment Instructions This assignment is to implement your own mini-grocery store in C++. Suppose you have the following Food hierarchy: FOOD FRUIT APPLE BANANA GRAPE DAIRY MILK YOGURT CHEESE (your choice) (three items ...

1 create a c visual studio console application with the

1. Create a C++ visual studio console application with the name Project2. (As usual, to make the grader happy, it is critical that your project as well as your zip file contain your name and the exercise or project numbe ...

Assignmentpart acomplete the following questionswrite c

Assignment Part A Complete the following questions: Write C++ code to open a document with the name Hello.txt, place the message "Hello, World!" in the document, and exit the document. Re open the file you closed, and re ...

Assignmentoverviewthis assignment consists of implementing

Assignment Overview This assignment consists of implementing an application using the techniques learned in the first half of the course. Examples on how to use file operations, random number generation, the standard tem ...

Design implement test and debug a c program to simulate the

Design, implement, test, and debug a C# program to simulate the rolling of two dice 100 times. Whenever the two dice display the same number, the program should show the roll sequence number (e.g. the 10th roll) and the ...

Programming in cbubba tubs bbq rub is a company that makes

Programming in C++ Bubba Tub's BBQ Rub is a company that makes different BBQ dry rubs and sauces. They make each product when it is ordered with the freshest ingredients and sell it by the unit. A unit is 2 ounces of pro ...

Programming assignment 5write a c program that allows the

PROGRAMMING ASSIGNMENT #5 Write a C program that allows the user to make some banking transactions. The program should first prompt the user to enter the current balance of his/her bank account (in dollars and cents, not ...

Write a program that reads numbers from cin and then sums

Write a program that reads numbers from cin and then sums them, stopping when 0 has been entered. Construct three versions of this program, using the while, do - while , and for loops. Add the following to your program: ...

  • 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

WalMart Identification of theory and critical discussion

Drawing on the prescribed text and/or relevant academic literature, produce a paper which discusses the nature of group

Section onea in an atwood machine suppose two objects of

SECTION ONE (a) In an Atwood Machine, suppose two objects of unequal mass are hung vertically over a frictionless

Part 1you work in hr for a company that operates a factory

Part 1: You work in HR for a company that operates a factory manufacturing fiberglass. There are several hundred empl

Details on advanced accounting paperthis paper is intended

DETAILS ON ADVANCED ACCOUNTING PAPER This paper is intended for students to apply the theoretical knowledge around ac

Create a provider database and related reports and queries

Create a provider database and related reports and queries to capture contact information for potential PC component pro