Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I am trying to figure how to work on my Deck Class. Ive been having troubles with writing code for Public void display() Public void
I am trying to figure how to work on my Deck Class. Ive been having troubles with writing code for Public void display() Public void shuffle() Public Card deal() The deck constructor was given but I have problems solving for the other three functions in the Deck Class. Solitaire Prime tiance is a card game that is played by one person. Solitaire is also known by the name because we ed that there are more than 1700 different versions of Solitaire... make that 1701 Patience we are inventing a new Solitaire game today standard deek of cards. Here are Prime! This game uses one standard deck of cards. Here are the rules: Take the top card from the deck and place it face up on the table. 2) 1) The Surn is now the value of that card (Ace = 1, 2-2, 10-10, Jack-10, Queen- 10, King 3) 10) If the Sunn is a prime number, discard that pile, and start over at instruction #1 4) If the Sum is not prime, take the next card from the top of the deck and place it on top of the pile on the table. 5) The Sum is now the sum of all cards in the pile on the table. Continue to play the game, keeping track of how many piles you have created t If the last card from the deck gives you a prime pile, then you win! Write the word hat are prime. "Winner" on the screen and show how many prime piles there were. If the last card from the deck does not give you a prime pile, then you lose. Write the word "Loser" in the screen. In the main function, you will have a menu that looks like this: Welcome to Solitaire Prime! 1) New Deck 2) Display Deck 3) Shuffle Deck 4) Play Solitaire Prime 5) Exit New Deck will create an unshufled deck. (Spades, Hearts, Diamonds, Club... Ace, 2, 3,. .0 Jack, Queen, King) Display Deck will display all cards in a grid: 13 columns by 4 rows. Shuffle Deck will randomly shuffle all cards in the deck. Play Solitaire will play the game as described above. xit will exit the program
I am trying to figure how to work on my Deck Class. Ive been having troubles with writing code for
Public void display()
Public void shuffle()
Public Card deal()
The deck constructor was given but I have problems solving for the other three functions in the Deck Class.
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