Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

JAVA Define a Class Card that will store the face value of the Card and the Suit

ID: 3684435 • Letter: J

Question

JAVA

Define a Class Card that will store the face value of the Card and the Suit Value 1. Include a minimun of 5 fields: Face Value as Integer Face Value as String Suit Value as Integer Suit Value as String Card number of 1 to 52 (or 0 to 51) 2. Include a method to return the value of both for printing. I suggest you use toString(). 2. Create a class for the Deck of Cards containing a set of operations that do the following: 1. Initializes a Linked List that contains all 52 cards in order. 2. Draws one card at a time from the Deck and removes the card from the deck. 3. Checks to see if there are any cards in the deck. 4. Keeps track of how many cards are left in the deck. 5. Shuffles the deck. 6. Print the deck for debugging purposes as you test your game. 3. Create a class for a dealt hand of cards containing a set of operations that do the following: 1. Initializes an empty hand of cards. 2. Prints the hand of cards. 3. Keeps track of how many cards are in the h

Explanation / Answer

Card To represent a deck of cards, we need 52 Card objects public class DeckOfCards { private Card c1; private Card c2; ... private Card c52; // 52 Card variables !!! } public class DeckOfCards { public static final int NCARDS = 52; private Card[] deckOfCards; // Contains all 52 cards /* --------------------------------------------------- The constructor method: make 52 cards in a deck --------------------------------------------------- */ public DeckOfCards( ) { /* ================================================================= First: create the array ================================================================= */ deckOfCards = new Card[ NCARDS ]; // Very important !!! // We must crate the array first ! /* ================================================================= Next: initialize all 52 card objects in the newly created array ================================================================= */ int i = 0; for ( int suit = Card.DIAMOND; suit