Question: Create a Java class in BlueJ called Card . The class should have the following: A field called rank which stores the value of the

Create a Java class in BlueJ called Card. The class should have the following:

A field called rank which stores the value of the card. The integer values 1 through 10 will denote the cards Ace through Ten. Jack, Queen and King will be stored as the integer values 11 through 13 respectively.

A field called suit which stores the suit of the card. The values 'C', 'D', 'H', and 'S' will denote the suits Club, Diamond, Heart, and Spade respectively.

A method called getSuit which returns the suit of a card object.

A method called getRank which returns the rank of a card object.

A method called setSuit which sets the suit of a card object to a given value.

A method called setRank which sets the rank of a card object to a given value.

A method called setCard which sets both the suit and rank of a card object to specified values.

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!