Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ Write a program that will operate on a deck of 52 cards. Your program will: 1.Deal them into four random hands of 5 cards

C++

Write a program that will operate on a deck of 52 cards. Your program will:

1.Deal them into four random hands of 5 cards each

a.The four hands need to be kept in an array for later use.

2.Sort each hand so that it shows the cards in sequence from two as the lowest to ace as the highest.

3.Display the cards in each hand using the card face (2, 10, King, etc.) and the suit (Spades, Hearts, etc.)

4.Display what you determined the hand to be. A ranking of poker hands is at http://www.pagat.com/vying/pokerrank.html

a.Straight flush

b.Four of a kind

c.Full House

d.Flush

e.Straight

f.Three of a kind

g.Two pair

h.One pair

i.Highest card

5.Each time the program is run, a different set of hands is to be dealt.

6.Determine which is the winning hand. A tie is possible. (25 points)

NOTES:

1. Use a structure to hold the face value and suit of each card.

2. Use arrays to hold the deck of cards and the hands.

3. Use enumerations for the values of Jack, Queen, King, and Ace and to identify the suits (Diamonds, Clubs, etc.).

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

DB2 11 The Database For Big Data And Analytics

Authors: Cristian Molaro, Surekha Parekh, Terry Purcell, Julian Stuhler

1st Edition

1583473858, 978-1583473856

More Books

Students also viewed these Databases questions