Question: Java to UML Review the following Java Code for the children's card game called War. Create the UML class diagram which corresponds to this code.

 Java to UML Review the following Java Code for the children's

Java to UML Review the following Java Code for the children's card game called "War". Create the UML class diagram which corresponds to this code. Make sure to account for all the classes, attributes, methods, relationships, access specifiers and multiplicity. You can draw this out by hand and take a picture (be legible!) or use a modelling tool. I use StarUML which can be downloaded for free. War.java public class War { public static void main(String[] args) { CardHand player1 = new CardHand(); CardHand player2 = new CardHand(); Deck d = new Deck(); Card.java public class Card { private String suit; private int rank; } public void setSuit(String s) { } } public void setRank(int r) { } CardHand.java public class CardHand { private ArrayList hand; public int getRank() { } public CardHand() { } private String rankString(int n) { } public void addCardToEnd(Card c) { public Card getCardFromFront() { } Deck.java public class Deck { private ArrayList cards; public boolean isEmpty() { } public Deck() { } } public void shuffle() { } public boolean isEmpty() { } public Card drawCard() { } Notes: Pay attention to the type of relationship between classes and implement each one appropriately. Watch multiplicities and access specifiers

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!