Question: The objective of this assignment is to implement a basic API for Card games, and then code a imple Card game. Card.iava Define a Card





The objective of this assignment is to implement a basic API for Card games, and then code a imple Card game. Card.iava Define a Card class with the following API public Card(Suit suit, int rank) public int getRank() public Suit getSuit() public String toStringI "Ace of Spades" Note that Suit is an enumerated type. Your Card class should also implement the Comparable interface. Order cards in ascending order of their rank within a Suit, with the different Suits ranked, from lowest to highest, as CLUBS, DIAMONDS, HEARTS, SPADES. Deck.java Implement a Deck class that keeps an ArrayList of cards. Provide the following API: public Deck() public String toString) // print all cards in deck public boolean isDeckEmpty() public Card deal() //deals the topmost card in deck public void shuffle() //shuffles cards in deck
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
