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

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 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

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question

Java How To Program Late Objects Version

ISBN: 9780136123712

8th Edition

Authors: Paul Deitel, Deitel & Associates

Question Posted: