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

Assignmentconsider the following declarationsclass

Assignment Consider the following declarations: class bagType { public: void set(string, double, double, double, double); void print() const; string getStyle() const; double getPrice() const; void get(double, double, dou ...

Write a c program that requests the name of any cartoon

Write a C program that requests the name of any cartoon character from the user, then does the following with that name (use printf for each): a. Displays it enclosed in double quotes. b. Displays it in a field 24 charac ...

Write a c application that does the followingitem 1 prompts

Write a C++ application that does the following: ITEM 1: Prompts the user to choose one of the following series: 1 + 1/2 + 1/3 + ... + 1/n ((((x * 2) * 2) * ...) * 2) series of n multiplications x + (x * 1) + (x * 2) + ( ...

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

Assignmentobjectivespractice reading characters from a

Assignment Objectives Practice reading characters from a file Practice using command line input Practice using command-line redirection of files Practice implementing a double transposition ciphering algorithm Summary In ...

Computer scienceyou have gathered your information on the

Computer Science You have gathered your information on the AI for the Tic-Tac-Toe game and began to develop your own ways to improve it using C++. Now, it's time to present your findings in a final paper. Remember that y ...

Computer applications divisionassignment c programmingstl

COMPUTER APPLICATIONS DIVISION Assignment: C++ PROGRAMMING STL Vector For this assignment, you will be starting with an example program that demonstrates the use of a STL vector. In addition to this, you may need to look ...

Write a c program that prompts the user to enter a line of

Write a C program that prompts the user to enter a line of text (up to 50 characters). It should then convert the text entered to uppercase letters and then to lowercase letters, and then to Sentence case. Your program s ...

Discussionobject-oriented design please respond to the

Discussion "Object-Oriented Design" Please respond to the following: • Suppose you were required to write a C++ program that captures and stores data about automobiles that a small dealership in your city sells. Consider ...

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

  • 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

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

Describe what you learned about the impact of economic

Describe what you learned about the impact of economic, social, and demographic trends affecting the US labor environmen