Question: This activity is designed to help you learn how to use collection classes. Therefore, your implementation should use an ArrayList. You should not implement list

This activity is designed to help you learn how to use collection classes. Therefore, your implementation should use an ArrayList. You should not implement list methods from scratch
| import cards.*; | |
| import hands.*; | |
| public class Activity5 { | |
| public static void main(String[] args) { | |
| Deck d = new Deck(52); | |
| HandOfCards hand = new HandOfTwo(); | |
| hand.addCard(d.dealOne()); | |
| hand.addCard(d.dealOne()); | |
| System.out.println("Hand :"); | |
| hand.printHand(); | |
| } | |
| }
Add a 3rd hand of cards class called ArrayListHand that uses the Java ArrayList (not the implementation from the Java Foundations book) as the underlying data structure. Your new class should also implement the HandOfCards interface and be included the hands package. 4) Create 3 hands of cards, one using each of the 3 different classes that implement the HandofCards interface. Display the contents of each hand of cards. Your output should indicate the type of hand you are displaying. 5) You should make use of polymorphism and other techniques we have discussed in class to make your code as succinct as possible. |
1) Open Eclipse 2) Download the source code from https://github.com/CGCC-CS/S16205Activity5.git. The source code contains a card package with a Deck class & PlayingCard class. There is also a hands package with two different implementations of a hand of cards. 3) Add a 3rd hand of cards class called ArrayListHand that uses the Java ArrayList (not the implementation from the Java Foundations book) as the underlying data structure. Your new class should also implement the HandOfCards interface and be included the hands package. Create 3 hands of cards, one using each of the 3 different classes that implement the HandofCards interface. Display the contents of each hand of cards. Your output should indicate the type of hand you are displaying 4) 5) You should make use of polymorphism and other techniques we have discussed in class to make your code as succinct as possible. Submission requirements: Include your name as a comment at the top of each source code file Make good use of whitespace/comments to make your implementation clear. In a well-formatted .doc, .pdf, or txt file, briefly describe your implementation, give sample output, and include your entire ArrayListHand clas:s. Zip your entire Eclipse project (includingclass files). Do not use .rar. Include your first and last name in the .zip filename Upload your implementation/output document & zipped project separately to Canvas (Optional) Turn in a hard copy of your implementation document . * . Be prepared to demo your project in class
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
