Question: ava Using the following UML, create a class called Card, which represents single object in a pack of playing cards. It holds a value 1-13

 ava Using the following UML, create a class called Card, which

ava Using the following UML, create a class called Card, which represents single object in a pack of playing cards. It holds a value 1-13 inclusive, which represents (Ace, 2, 3, .. , Jack, Queen, King) and a suit 1-4 inclusive (Spades, Clubs, Diamonds, Hearts) which is given when a Card is constructed (ensure that these values can't be set with invalid numbers). It has suitable "getter" methods which retrieve this information and a toString method (feel free to also use private helper methods), which converts the value and suit to a suitable output String (eg: if value-1, suit-2 then toString will return [AC] if value 4, suit 4 toString returns [4H], if value-12, suit-1 then toString returns [Qs]) Card Deck - suit: int - value int - dec k : Cardl - deckSize: int MAX_SIZE 52: int +Deck() +Deck(fullDeck:boolean) initialiseFullDeck): void +drawCard) Card +placeCard(card : Card): void 0...52 +Card(value: int, suit: int) +getValue(): int +getSuit(): int +toString(): String 1+shuffle() void +getDeckSize() : int hasCardsRemaining(): boolean +toString() : String > Comparable +Snap() - setupPlayerDecks() void - pickupPile (player:int): void - checkSnap(): boolean +snap(player int): boolean +drawCard(player int) : Card +hasGameFinished(): boolearn +isWinner(player : int) : boolean +getPlayerTurn(): int +getPlayerCardsRemaining(player:int): int +mainlaras: Strin DrinkingGame +mainlaras: String): void void

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!