Question: *****JAVA************* Deck of Cards Lab Program a Card class with these fields: number an integer between 1 and 13 suit an enumerated data type with

*****JAVA*************

Deck of Cards Lab

Program a Card class with these fields: number an integer between 1 and 13 suit an enumerated data type with values { Spade, Heart, Diamond, Club } description a string with card name for example Spade Ace or Heart 5

Card number 1 represents an Ace. Cards 11 though 13 represent a Jack, Queen, and King. Your class should have these methods: Card(int n, Suit s) constructor that initializes suit to s and number to n void setDescription() using suit and number, set description to a string like Spade King void display() print description on console

Write a main program which creates and displays a deck of 52 cards. The display should look like this:

Spade Ace Heart Ace Diamond Ace Club Ace Spade 2 Heart 2 Diamond 2 Club 2 Spade 3 Heart 3 Diamond 3 Club 3 Spade 4 Heart 4 Diamond 4 Club 4 Spade 5 Heart 5 Diamond 5 Club 5 Spade 6 Heart 6 Diamond 6 Club 6 Spade 7 Heart 7 Diamond 7 Club 7 Spade 8 Heart 8 Diamond 8 Club 8 Spade 9 Heart 9 Diamond 9 Club 9 Spade 10 Heart 10 Diamond 10 Club 10 Spade Jack Heart Jack Diamond Jack Club Jack Spade Queen Heart Queen Diamond Queen Club Queen Spade King Heart King Diamond King Club King

Your Card class and main program must be in two separate files.

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!