Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started