Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

A deck of playing cards consists of 52 cards divided into four suits: hearts, cl

ID: 3884954 • Letter: A

Question

A deck of playing cards consists of 52 cards divided into four suits: hearts, clubs, diamonds, spades. Within each suit there are thirteen cards, labelled 2, 3, 4, 5, 6, 7, 8, 9, 10, J, Q, K, A. For this assignment you'll need to create two classes, Deck and Card. The deck should use an ArrayList to hold the list of cards. Your Deck class needs methods which performs the following: Last Modified: 08/28/17 Prints every card in the deck Shuffle the cards in the deck (randomly swapping every card in the deck) Add a new card to the deck Remove a card from the deck (the first card stored in the ArrayList object) Sort the cards in the deck ordered by name Include a main method in your Deck class which validates the methods you made. Save your solution in files named Deck.java and Card.java.

Explanation / Answer

// Card.java

// Deck.java