Answered step by step
Verified Expert Solution
Question
1 Approved Answer
**Please write code in Java and add comments where necessary!!** Here are the minimum requirements for your card game: You must have a Card class
**Please write code in Java and add comments where necessary!!**
Here are the minimum requirements for your card game: You must have a Card class with the minimum below: Each card object must have a (String) suit, (String) rank, and a (int) point Value Must provide accessor methods for each of these class variables Must have an equals method to compare if the current card and another card are the same Must have a toString method that prints the current card displaying its attributes You must also have a Deck class with the following minimum: Import statements: import java.util.List; import java.util.ArrayList; Class variables that consist of an ArrayList of Cards and also a size (int) variable Constructor that takes in three arrays for each of the Card attributes and fills up the arraylist with the newly created Card objects Constructor should set the initial size of the deck and call a method to shuffle the deck Additional methods o isEmpty() to check to see if the deck is empty (no undealt cards) o size() method to access the number of undealt cards o shuffle() method to randomize the collection of cards o deal() to deal a card from deck...returns a Card object or null if all the cards have been previously dealt o toString() method to print the entire deck First printing the undealt cards Then printing the dealt cards Important to note about the Deck class: you will never remove a card from the list of cards. Your size variable will keep track of the next card to deal. The actual deck will remain intact. Depending on your game that you design, you may need a Hand, Player, or even a Board classStep 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