Question
Please create the BlackJack 21 Card Game: For this assignment, your group will agree on a multi-player turn-based card game to implement. You have creative
Please create the BlackJack 21 Card Game:
For this assignment, your group will agree on a multi-player turn-based card game to implement. You have creative freedom with the card game you choose, but it must be complex enough to require, at a minimum: Player, Card, Deck and Hand classes Handling cards in some way dealing, shuffling, sorting, etc. Players take turns Recognizing a winner Examples for a standard playing deck are provided, but you are not restricted to only card games that use these playing cards. Implement your classes in the order given below. All classes described below are required.
1.4.1 Card Write a Card class to represent a playing card. Provide constructors and accessor methods for all instance variables, and a toString() method for displaying the card. Note that the instance variables for Card typically cant change so they should be final. Have it implement Comparable (which will require you to write a compareTo() method) so it will be easier later to compare cards. You should also override the equals() method. You may want to use enums for face/rank, suit, color, etc. (samples for standard playing cards are provided) Test your Card class before you proceed! For this course, this can be JUnit tests or including a main() method in each class, with object creation and method calls.
1.4.2 Pile (of cards) Write a Pile class to represent a general pile of cards. Your pile must be/utilize a List. You can use any List implementation (from the Java library class) but you must limit yourself to use only List and Iterator methods. Provide constructors and accessor methods for all instance variables, and a toString() method Include methods representing operations on piles of cards, such as: Shuffling and Sorting Removing and adding cards Searching Splitting Grouping by face/rank or suit Other? Other methods may be added later if you determine that you need them. Thoroughly test your Pile class methods before you proceed. (This will save you time and frustration later). 2 of 3 COMP2000 Data Structures Fall 2018 List Application Due: Nov 11, 2018 at 11:59PM
1.4.3 Deck and Hand Extend classes Deck and Hand from Pile. Add instance variables and methods specific to each. For example, Deck might have a deal() method. Provide constructors and accessor methods for all instance variables, and a toString() method. Once you write a card game class you may determine that these classes need additional instance variables and methods. The default constructor for a Deck will probably instantiate all of the Cards in the Deck. Thoroughly test your Deck and Hand classes before you proceed!
1.4.4 Player Write a Player class. Include instance variables related to players, such as name, hand (instance of your Hand class), and score. Include methods related to players. These may also be added later as you write your game class. Thoroughly test your Player class before you proceed.
1.4.5 Game Write a game class. Name it according to the game you implement. Include instance variables related to your type of game, such as Players and at least one Deck. The Game class is responsible for implementing the rules of the game, and for keeping track of the turns. Depending on the game you are implementing, the methods you have might include initialize() to set up for a new game, and play() to run the game. You may develop additional classes if they make your implementation cleaner and/or more elegant. By running your Game class, your program should display information and read user input to run the actual game
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started