Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Deck of Cards Java Full Rating With Answer Must use random number generator to decide how many cards will be listed (can be greater than

Deck of Cards

Java

Full Rating With Answer

Must use random number generator to decide how many cards will be listed (can be greater than 52, so cards must be reshuffled if number generated is greater than 52)

Thanks!

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Design an object card Design an object Deck Design a driver program

Use these class diagrams to create your objects.

------------------------------------- Card ------------------------------------- -int _value //Will be between 1 and 13, 1 for ace, 2-10 number cards, 11 for jack, 12 for queen, 13 for king// Hope that helps -String _suit -String _Color -String _Face ------------------------------------- +Card(int value, String suit) +String toString() +String getColor() +String getFace() +int getValue() +String getSuit() ------------------------------------

------------------------------------ Deck ------------------------------------ -List _cards ------------------------------------ +Deck() -void loadCards() +Card drawCard() +int getDeckSize() +void shuffle() ------------------------------------

Write a driver program that produces the output below. Your program must match the provided class diagrams. The program must draw a card randomly from a standard deck of 52 cards. Your program must not print the same card twice until the deck runs out. Your program must shuffle the deck when it runs out of cards. Your program should produce different output every time it runs (Based on randomly selecting cards) Each object and the driver program should be in separate files.

SAMPLE RUN #1: java Driver

Printing 79 random cards

Jack of Spades

5 of Diamonds

10 of Spades

3 of Clubs

Ace of Diamonds

King of Clubs

King of Hearts

7 of Clubs

2 of Diamonds

8 of Spades

9 of Clubs

2 of Spades

Ace of Spades

2 of Clubs

10 of Hearts

3 of Spades

2 of Hearts

4 of Spades

7 of Spades

Queen of Spades

10 of Diamonds

3 of Diamonds

Queen of Hearts

6 of Diamonds

9 of Hearts

King of Diamonds

4 of Diamonds

8 of Hearts

Jack of Hearts

Queen of Clubs

Ace of Hearts

7 of Diamonds

10 of Clubs

9 of Diamonds

Jack of Diamonds

Queen of Diamonds

4 of Clubs

6 of Hearts

8 of Diamonds

6 of Spades

7 of Hearts

3 of Hearts

8 of Clubs

5 of Spades

9 of Spades

5 of Hearts

King of Spades

4 of Hearts

6 of Clubs

Ace of Clubs

5 of Clubs

Deck is empty, shuffling!

Queen of Hearts

6 of Diamonds

4 of Spades

7 of Diamonds

Queen of Clubs

4 of Diamonds

8 of Hearts

King of Diamonds

5 of Spades

Jack of Clubs

7 of Hearts

7 of Clubs

2 of Diamonds

6 of Hearts

6 of Clubs

Jack of Diamonds

Queen of Diamonds

4 of Hearts

3 of Clubs

10 of Diamonds

Ace of Spades

Ace of Hearts

3 of Hearts

5 of Clubs

8 of Spades

3 of Diamonds

King of Clubs

King of Spades

Deck Remaining 24

Poker Hand !

10 of Spades

2 of Hearts

Ace of Diamonds

Jack of Spades

King of Hearts

Deck Remaining 19

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

Introduction To Data Mining

Authors: Pang Ning Tan, Michael Steinbach, Vipin Kumar

1st Edition

321321367, 978-0321321367

More Books

Students also viewed these Databases questions

Question

Brief the importance of span of control and its concepts.

Answered: 1 week ago

Question

What is meant by decentralisation?

Answered: 1 week ago

Question

Write down the Limitation of Beer - Lamberts law?

Answered: 1 week ago

Question

Which personal relationships influenced you the most?

Answered: 1 week ago

Question

What were your most important educational experiences?

Answered: 1 week ago