Question: Modify Fig.7.13 to deal a five-card poker hand. Then modify class DeckOfCards of Fig.7.12 to include methods that determine whether a hand contains a) A

Modify Fig.7.13 to deal a five-card poker hand. Then modify class DeckOfCards of Fig.7.12 to include methods that determine whether a hand contains

a) A pair

b) Two pairs

c) Three of a kind (e.g., three jacks)

d) Four of a kind (e.g., four aces)

e) A flush (i.e., all five cards of the same suit)

f) A straight (i.e., five cards of consecutive face values)

g) A full house (i.e., two cards of one face value and three cards of another face value)

Fig.7.13I // Fig. 7.13: DeckOfCards Test.java // Card shuffling and dealing. 2 3 4 public class DeckOfCards Test { //

Fig.7.12

I // Fig. 7.12: DeckOfCards.java 2 // DeckOfCards class represents a deck of playing cards. 3 import

I // Fig. 7.13: DeckOfCards Test.java // Card shuffling and dealing. 2 3 4 public class DeckOfCards Test { // execute application 5 6 7 8 9 10 II 12 13 14 15 16 17 18 19 20 } public static void main (String[] args) { DeckOfCards myDeckOfCards = new DeckOfCards (); myDeckOf Cards.shuffle (); // place Cards in random order } // print all 52 Cards in the order in which they are dealt for (int i = 1; i

Step by Step Solution

3.38 Rating (154 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Based on your request you want to modify the DeckOfCardsTest class to deal a fivecard poker hand and update the DeckOfCards class with methods to dete... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Java How To Program Late Objects Questions!