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

Need help in java. Thank you. We will build a Deck class which will let us build

ID: 3784192 • Letter: N

Question

Need help in java. Thank you. We will build a Deck class which will let us build a deck of cards (52 Cards) consisting of 4 suits Clubs, Diamonds, Hearts and elets SPADE Each suit will have 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 and 14 whereby upon printing a card, the 11 will be printed as Jackof... the 12 will be printed as Queen of the 12 will be printed as King of and the 14 will be printed as Ace of ...They will store this Deck of Cards inside of an array. They will also add other methods that may need now or when they will be using this in the main program later. will add more to this later to eventually let them develop the card game.

Explanation / Answer

import java.util.*;

import java.lang.*;

import java.io.*;

class DeckOfCards
{
   enum Suit{CLUB,DIAMOND,SPADE,HEART}
   enum Value{ACE,TWO,THREE,FOUR,FIVE,SIX,SEVEN,EIGHT,NINE,TEN,JACK,QUEEN,KING}
private class Card
{
   Suit suit;
Value value;
public Card(Suit suit, Value value)
{
this.suit=suit;
this.value=value;
   }
   public Suit getSuit()
   {
       return suit;
   }
   public Value getValue()
   {
   return value;
   }
   }
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote