Question: Your task is to write a program in java that prompts the user for a poker hand (five cards, each of which has a rank
Your task is to write a program in java that prompts the user for a poker hand (five cards, each of which has a rank [2-10, Jack, Queen, King, or Ace]and a suit[Hearts, Diamonds, Spades, or Clubs]) and identifies the following types of hands:
Royal Flush: Ace,King, Queen, Jack and 10 of the same suit, e.g.,Ace Diamonds,King Diamonds,Queen Diamonds,Jack Diamonds,10 Diamonds
Four of a Kind: Four cards with the same rank, e.g.,4 Hearts, 4 Diamonds, 4 Spades, 8 Clubs, 4 Clubs
Flush: Five cards with the same suit, e.g.,10 Hearts, 2 Hearts, 4 Hearts, Jack Hearts, 7 Hearts
High Card: No two cards have the same rank and not all cards have the same suit, e.g.,King Hearts, 3 Hearts, 9Diamonds, 10 Spades, 4 Diamonds
There are other types of poker hands(straight, three of a kind, etc.),but they are more difficult to recognize, so were just going to focus on these.If the users hand is none of the things listed in bold above, your program should output I dont recognize this hand.
Examples:
Enter your hand: Queen Hearts Queen Diamonds 9 Hearts Queen Spades Queen Clubs
Four of a Kind
Enter your hand: 7 Spades 2 Clubs 4 Clubs 9 Spades Jack Hearts
High Card
Enter your hand: 7 Spades 7 Diamonds 10 Hearts Jack Hearts 9 Clubs
I dont recognize that hand
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
