Posted this program 8 times and still no luck. This java code is a simulation of
ID: 3833574 • Letter: P
Question
Posted this program 8 times and still no luck. This java code is a simulation of the clock solitaire game. This game only needs 4 classes. A card class is needed to represent each of the 52 playing cards.
Class.java: has to have constuctors, getSuit(), getValue() and String toString(): to print cards e.g., “10H” or “QD” .
Deck.java: that represents a standard deck of 52 playing cards. Methods to use constructors, void shuffle() which shuffles the deck of cards, Card dealCard(), int cardsLeft(), String toString(), iterate through your deck array, printing all the cards, in a way that’s convenient to check what cards are there; we think it’ll be best to print all the cards on one line
Pile.java: class that contains no more than five cards some are face down and some are faced up. Methods constructors, void addCardFaceDown( Card card), Card removeCard() removes and returns the "top" face down card (null if there are not any) int getNumberOfFaceDown(), void addCardFaceUp( Card card) int getNumberOfFaceUp() and String toString() print the cards in the on one or two lines; label the portion of the pile that’s face up versus face down.
Driver.java: where the game is executed. Print number of games played and how many games user won and percentage
You can use other methods that are not listed. The ones I have are needed if not it will be okay if simulation runs.
Thumbs up for a simulation that runs with 4 classes that I can run.
This is how the game is played https://youtu.be/6AEJEf8L95g https://youtu.be/yUj320C9210
Explanation / Answer
Find the below code as required in the problem statement:
Card.java
**************
*****************
Deck.java
*********************
Hand.java
****************************
Suit.java
********************
Value.java
*************************
P.S THE ABOVE CODE IS THE WORKING CODE AND YOU CAN USE IT WITH RESPECT TO YOUR ASSIGNMENT OR THE JAVA PROJECT
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.