The program begins by dealing five cards each to two players. The next part of the program prints out each player's hand, representing each card in the hand as a 2-character String with rank (AKQJT98765432) and suit (hdcs), and its evaluation. Note that PokerHandAssessor.java contains an assess() method that will print out a hand evaluation. Finally, the program determines which player has the better hand and prints out the result. If both players have quads, or both players have ushes, or both players have trips, the program should print out that they tied (in contrast to traditional poker, where the rank of the quads, flush, or trips matters). Remember that quads beat flushes, flushes beat trips, and trips beat high card hands. If both players have only high card hands, you should determine the winner by determining whose high card is higher. If the high cards have the same rank, then the round is a tie (the suit does not matter).
Your program should match the execution log shown below, except for those parts that were determined at random (the playing cards, the type of hands, the winner).
In the PokerHand class, you should implement a constructor that takes 5 Strings as parameters, representing the five cards in the hand. You should also implement two instance methods:
In the Dealer class, you should fill out the skeleton code in order to implement the main method, the dealOneCard method, the dealOneHand method, and the playOneRound method. To repeat: do not modify PokerHandAssessor.java for this assignment. You will find it very useful to use, but do not change it, and do not hand it in. You should not refer to PokerHandAssessor anywhere in the Dealer class. Only the PokerHand class may use it. Thus the PokerHandAssessor class is decoupled from the Dealer class.
This program deals 5-card hands to two poker players, and determines whose hand is better. Round 1: Player 1: Ks As Ts 8h 6h A high Player 2: 2s 8h 8d Jh Js J high Player 1 wins. Do you want to play another round? yes Round 2: Player 1: As 9c 5d Jh Ac A high Player 2: As 4c 5h Ks 9s A high It's a tie! Do you want to play another round? no Good Bye