Question: This is C++ program. Please do not reuse any program on Chegg. Program Set #1 Total Points: 30 Three problems must be implemented for full
This is C++ program. Please do not reuse any program on Chegg.
Program Set #1 Total Points: 30 Three problems must be implemented for full credit. Each section will state how many problems to implement within it. The required (starred) problem marked in the set must be implemented by everyone. See 2436 Grading Guide Sheet for additional grading/submission information. Partial credit will be given. (10 points each) Section One- COSC 1436/COSC 1437 Review. Choose two problems. 1. Write a program that determines a winner of a 2-player poker match. A poker hand of five playing cards drawn from a standard 52-card deck has a value, based on the table below. Each card has a rank (29, 10, Jack, Queen, King, or Ace) and a suit (, , , or ). The first character in each string will be the rank of the card and will be one of A23456789TJQK. The second character in the string will be the suit of the card and will be one of CDHS. Thus, "AS" represents the Ace of Spades, while "TC" represents the Ten of Clubs. 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 (convert 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 winner determined by tie breaker royal flush always a tie straight flush highest value card four of a kind highest value four of a kind full house highest value three of a kind flush highest value card; else next highest value card; else next highest, etc. straight highest value card three of a kind highest value three of a kind; else highest value lone card; else next highest value lone card two pairs highest value pair; otherwise, next highest value pair; else highest value lone card one pair highest value pair; else highest value lone card. else next highest value lone card; else next highest value lone card high card highest value card; else next highest value card; else next highest, etc.Output will consist of a line of text by itself, consisting of the players name, strongest poker hand cards (in CAPITAL LETTERS) and the fully described hand similar to below: AD KD TD QD JD: ROYAL FLUSH, Diamonds 5D 3D 2D AD 4D: STRAIGHT FLUSH, Diamonds, 5 high 9C 9S JH 9D 9H: FOUR OF A KIND, 9s 7S 4C 7C 7D 4S: FULL HOUSE, 7s full of 4s (NOTE: full of ) QD 9D 7D 4D 3D: FLUSH, Diamonds, Q high COSC 2436 S21 3 AC JS KC QD TS: STRAIGHT, A high QS 4C QH 7S QD: THREE OF A KIND, Qs TS 8H TC 8C AD: TWO PAIR, Ts and 8s (NOTE: Higher ranking pair is listed first) 4J TD 4S KS 5S: ONE PAIR, 4s KC 3D 2H AS JH: HIGH CARD, K High Finally, output to the screen the winner and ask the user if he/she would like to play again (upper and lowercase). Error check as needed. A standard deck of cards is used- no jokers. No betting required. The program must use user-defined functions/methods, only use one dimensional arrays, no vectors or ArrayLists to represent data, and does not use any sorts. Also, do not use break or continue statements with loops or bitwise operations. For C++ use the string class.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
