Could someone please code this Java UML. it is War Card game with 2 playes and 5
ID: 3695438 • Letter: C
Question
Could someone please code this Java UML. it is War Card game with 2 playes and 52 cards and deck and higher card wins and they should play untill nothing left in their hands also it should be the same as the UML as possible.
**** NO GUI please, just a normal input "scanner".
GroupOfCards Card -cards currentSize: int +addCard(card: Card): void num: int -suit:int +displayO void isplay0 : void Deck Hand +shuffle0: void +dealCardO: Card +sort): void +playACard0 Card Game -deck: Deck -playerl Hand -player2: Hand +playAGame voidExplanation / Answer
import java.util.*; class Deck { // create possible card combinations public final String[] SUITS = { "H", "D", "C", "S" }; public final String[] RANKS = { "A", "K", "Q", "J", "10", "9", "8", "7", "6", "5", "4", "3", "2" }; // maximum number of cards public final int deckLength = SUITS.length * RANKS.length; public List fullDeck = new ArrayList(); public Deck() { for(int i = 0; iRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.