Question: JAVA Code: Design and implement a class called Card that represents a standard playing card. Each card has a suit (Diamond, Club, Heart, Spades) and

JAVA Code:

Design and implement a class called Card that represents a standard playing card. Each card has a suit (Diamond, Club, Heart, Spades) and a face value (1 - 10, Jack, Queen, King). Hint. You can use integers to represent the suit and face values. Then design and implement another class called Player. This Player class should have a method called "drawCards" which will draw 5 random cards. Then create a driver program (class with the main method) will create an instance of the Player class and call drawCards() on the instance. After the drawCards() is called, your driver will pass the player instance to the System.out.println() method; this will print the 5 cards the player has pulled.

Here is what the main method in your driver program should look like: Player p = new Player(); p.drawCards(); System.out.println(p);

Remember this is replicating one deck of cards, meaning you cannot draw the same card more than once.

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!