Include get and set methods for each field write an


a. Playing cards are used in many computer games, including versions of such classics as Solitaire, Hearts, and Poker. Design a Card class that contains a string data field to hold a suit (spades, hearts, diamonds, or clubs) and an integer data field for a value from 1 to 13. Include get and set methods for each field. Write an application that randomly selects two playing cards and displays their values.

b. Using two Card objects, design an application that plays a very simple version of the card game War. Deal two Cards-one for the computer and one for the player-and determine the higher card, then display a message indicating whether the cards are equal, the computer won, or the player won. (In this game, playing cards are considered equal when they have the same value, no matter what their suit is.) For this game, assume the ace (value 1) is low. Make sure that the two Cards dealt are not the same Card. For example, a deck cannot contain more than one Card representing the 2 of spades.

Request for Solution File

Ask an Expert for Answer!!
Basic Computer Science: Include get and set methods for each field write an
Reference No:- TGS01474345

Expected delivery within 24 Hours