Modify the application of Figs. 7.117.13 to use Face and Suit enum types to represent the faces

Question:

Modify the application of Figs. 7.11–7.13 to use Face and Suit enum types to represent the faces and suits of the cards. Declare each of these enum types as a public type in its own source-code file. Each Card should have a Face and a Suit instance variable. These should be initialized by the Card constructor. In class DeckOfCards, create an array of Faces that’s initialized with the names of the constants in the Face enum type and an array of Suits that’s initialized with the names of the constants in the Suit enum type. 

Fig. 7.11

I // Fig. 7.11: Card.java 2 // Card class represents a playing card. 23 3 4 public class Card { 5 56700 6 7 8

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

Fig. 7.13

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

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: