Question: Posted this program a lot no luck. I need a java code. This program is a simulation of the clock solitaire game. This game only

Posted this program a lot no luck. I need a java code. This program 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 thats convenient to check what cards are there; we think itll 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 thats 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

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To create a simulation of the Clock Solitaire game in Java using the four classes you mentioned Card Deck Pile and Driver Ill walk you through the structure and functionality of each class Heres a ste... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!