this is all done in java take the first two pictures and follow the last pictures pr 5151138

This is all done in java. Take the first two pictures and follow the last pictures prompt. Thanks. I will rate. public class Hand { private final int maxCards; private int nCards; private Card cards[l; /** * COnstructor for a hand of carString.format(Trying to add a card to a full hand (max %d). maxCards)); cards [nCards++] = Ci /** * Get the full hand * @reIn the hand of cards example we used in class and in an in-class exercise, you could consider that hand and deck are both exa

public class Hand { private final int maxCards; private int nCards; private Card cards[l; /** * COnstructor for a hand of cards @param n how many cards are in a hand * / public Hand (int n) { if (n <= 0|| n > Deck.getDeckSize()) { throw new IllegalArgumentException( String.format( “%d is not a valid number of cards. range [1,8d])”, n, Deck.getDeckSize() ) ); } maxCards = n; cards = new Card[maxCards]; 0; / no cards in the hand yet nCards = } **/ * add a card to the hand of cards (i.e., we were just dealt a new card) еparam c */ the card to add to the hand public void addCard(Card c) { if (nCards >= maxCards) { throw new IllegalArgumentException( String.format(“Trying to add a card to a full hand (max $d)”, maxCards) ); } cards [nCards++] = } /** Get the full hand String.format(“Trying to add a card to a full hand (max %d)”. maxCards)); cards [nCards++] = Ci /** * Get the full hand * @return the hand of cards as an array of Cards */ public Card[ ] getCards() { Card set[ = new Card [nCards]; for int i = 0; i = nCards) { throw new IllegalArgumentException( // ) is not a String.format(“Asking for an illegal card (%d). typo, it is math notation for a range Range [0,8d)” n, nCards) ); return cards[n]; } } In the hand of cards example we used in class and in an in-class exercise, you could consider that hand and deck are both examples of a superclass that is a set of cards. Take the solution (my solution on Learn or yours) for the hand of cards in- class exercise. Create the superclass of Hand and Deck called CardSet (i.e., a set of cards). The superclass should contain the code that is common to the two classes. Hand and Deck now need to be changed to be subclasses of CardSet. Solving this problem involves moving code, but not a lot of code writing (but there is some new or changed code) The resulting behavior of this code should be the same as it was when you started. In other words, the driver/test code should run identically to how it ran before Turn in any new or changed Java files (if you turn in extra files, it is OK and I will ignore them). Due to limitations in Learn, you might have to put them into a zip (Linux, Windows) or tar (Linux) archive and submit that.

"Get 15% discount on your first 3 orders with us"
Use the following coupon
FIRST15

Order Now