Question
This should be done in java as simply as posible ,.,.,.,,..,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,,.,.,xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx create multiple classes that generate a deck of cards with 2 gamblers that will
This should be done in java as simply as posible ,.,.,.,,..,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,,.,.,xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
create multiple classes that generate a deck of cards with 2 gamblers that will have a certain hand of cards. //////////////////////////////////////////////////////////////////////////////////////////
create a cardDeck class that contains all the possible cards of a regular deck
Create a Card class that represents each card.
create an object from the cardDeck class In the main method
Create 2 gambler objects with any names
Make a loop that gives five playing cards to both the players.
Print both Player objects in order to display the player's name and hand of cards
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
In the cardDeck class
The card deck will contain a card object array with room for 52 cards
Have the cardDeck class constructor fill the card deck array with 52 unique cards. This includes the ranks- 1,2,3,4,5,6,7,8,9,10, jack, queen, king, ace. Also include the suits- clubs, hearts, spades, and diamonds
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Create a loop that goes through suits and ranks arrays.
Create one card object for every suit and rank combination
Create a method for dealing the playing cards that subtracts a random card from the card deck and adds it to the hand of the gambler. This should return just one card object.
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
in the playingCard class
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
make the ranks and suits Strings
Each playing card will contain a rank and suit
Cards rank and suit should set by constructor
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
toString method of this class to display as "Four of Clubs" for example
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Gambler class
-
A Gambler consists of a name. Each gambler also has 5 card object array
Have the gambler class constructor to establish the gamblers name and make an array that is empty.
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
gambler class contains addPlayingCard method that will have a playing card object as its parameter. This method should add cards to the gamblers hand which is an array of cards hand
Print gamblers name and their cards using toString
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