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

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 void

Explanation / 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; i