Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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 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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle 10g SQL

Authors: Joan Casteel, Lannes Morris Murphy

1st Edition

141883629X, 9781418836290

More Books