Write Java Code Simulates Start Card Game Ll Need 5 Classes Card Provided Carddealer Attri Q37142207

Write a java code that simulates the start of a card game.You’ll need 5 classes:

Card: Provided

CardDealer: no attributes, main() creates a new CardPlayer() andDeck(), then calls a .shuffle() method located in Deck, next deals5 cards to the player (call .deal() located in the Deck and passit’s result to .getCard() located in CardPlayer, finally call.showCards() located in CardPlayer.

CardPlayer: 1 attribute: private TreeSet hand; 1 command in theconstructor: hand=new TreeSet(new CardComparator()); and 2 othermethods: getCard(Card c) and showCards() which displays all 5 cardsin ascending order.

Deck: 1 attibute: an ArrayList named cards to hold the deck ofall 52 cards, a constructor that creates

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.