Question: 1 // Fig. 7.11: DeckOfCardsTest.java 2 // Card shuffling and dealing. 3 4 public class DeckOfCardsTest 5 { 6 // execute application 7 public static
1 // Fig. 7.11: DeckOfCardsTest.java 2 // Card shuffling and dealing. 3 4 public class DeckOfCardsTest 5 { 6 // execute application 7 public static void main(String[] args) 8 { 9 DeckOfCards myDeckOfCards = new DeckOfCards(); 10 myDeckOfCards.shuffle(); // place Cards in random order 11 12 // print all 52 Cards in the order in which they are dealt 13 for (int i = 1; i <= 52; i++) 14 { 15 // deal and display a Card 16 System.out.printf("%-19s", myDeckOfCards.dealCard()); 17 18 if (i % 4 == 0) // output a newline after every fourth card 19 System.out.println(); 20 } 21 } 22 } // end class DeckOfCardsTest
7.11
Modify the application of fig 7.11 to deal a five-card poker hand.
Java
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
