Question: Write a class whose instances represent a single playing card from a deck of cards. Playing cards have two distinguishing properties: rank and suit. Use

Write a class whose instances represent a single playing card from a deck of cards. Playing cards have two distinguishing properties: rank and suit. Use an enum type to represent rank and another enum type to represent suit. Write another class whose instances represent a full deck of cards. Both these classes should have toString methods. Write a small program to test your deck and card classes. The program can be as simple as creating a deck of cards and displaying its cards by calling its toString method.

(You might need to create the following files: Suit.java of enum type, Rank.java of enum type, Card.java, Deck.java and DeckDemo.java. ArrayList is recommended to represent 52 playing cards in Deck.java class).

This program needs to be done in Java

Thank you

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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!