Answered step by step
Verified Expert Solution
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)
*** 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):
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 cardStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started