Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(C++ please help) *** Poker*** Each card in the hand will have both a suit (clubs, diamonds, hearts, or spades) and a rank (2, 3,

(C++ please help)

image text in transcribed

image text in transcribed

image text in transcribed

*** Poker***

Each card in the hand will have both a suit (clubs, diamonds, hearts, or spades) and a rank (2, 3, 4, 5, 6, 7, 8, 9, 10, Jack, Queen, King, and Ace). The program will read a hand of five cards, and then classify the hand into one of the standard poker hand rankings listed below (best to worse):

image text in transcribed

If a hand falls into two or more categories, the program will choose the best one. Input will be from the keyboard and abbreviate the ranks and suits as follows:

Ranks: 2 3 4 5 6 7 8 9 T J Q K A

Suits: C D H S

5 (* Modify the poker program. Write a C++ program Play with two players and use a string to enter names via the keyboard. Hands will be input from the keyboard with five card representations, separated by a single space between each card (covert to uppercase). If the user enters an illegal card or tries to enter the same card twice, the program will ignore the card, issue an error, and then request another card. Check for high card winners and check for ties. Hands are ranked first by category, then by individual card ranks. That is, even the minimum qualifying hand in a certain category defeats all hands in all lower categories. The smallest two pair hand, for example, defeats all hands with just one pair or no pair. Only between two hands in the same category are card ranks used to break ties. The highest single card in each flush or straight is used to break ties (the ace-through-five straight is the lowest straight, the ace being a low card in this context) Within two pair hands, the higher pairs are first compared. If they tie, then secondary pairs are compared, and then finally the kicker if equal strength royal flush straight flush four of a kind full house flush straight three of a kind winner determined by tie breaker always a tie highest value card highest value four of a kind highest value three of a kind highest value card; else next highest value card; else next highest, etc highest value card highest value three of a kind; else highest value lone card; else next highest value lone card 5 (* Modify the poker program. Write a C++ program Play with two players and use a string to enter names via the keyboard. Hands will be input from the keyboard with five card representations, separated by a single space between each card (covert to uppercase). If the user enters an illegal card or tries to enter the same card twice, the program will ignore the card, issue an error, and then request another card. Check for high card winners and check for ties. Hands are ranked first by category, then by individual card ranks. That is, even the minimum qualifying hand in a certain category defeats all hands in all lower categories. The smallest two pair hand, for example, defeats all hands with just one pair or no pair. Only between two hands in the same category are card ranks used to break ties. The highest single card in each flush or straight is used to break ties (the ace-through-five straight is the lowest straight, the ace being a low card in this context) Within two pair hands, the higher pairs are first compared. If they tie, then secondary pairs are compared, and then finally the kicker if equal strength royal flush straight flush four of a kind full house flush straight three of a kind winner determined by tie breaker always a tie highest value card highest value four of a kind highest value three of a kind highest value card; else next highest value card; else next highest, etc highest value card highest value three of a kind; else highest value lone card; else next highest value lone card

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

Datacasting How To Stream Databases Over The Internet

Authors: Jessica Keyes

1st Edition

007034678X, 978-0070346789

More Books

Students also viewed these Databases questions

Question

3. The group answers the questions.

Answered: 1 week ago