Below is my assignment due on friday.Anyone can help on this ???
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 character data field to hold a suit of string (“Spades”, “Hearts”, Diamonds”, or “Clubs”), an integer data filed for a value from 1 to 13, and field to hold the string representation of a Card’s rank based on its value as below :
Numeric Value String Value for rank
2 through 10 “2” through “10”
Include get and set methods for each field, save the class as Card.java.
Write the application so the suit and value both are chosen randomly. Using the two Card objects, play a very simple version of the card game War.
Deal two cards, one for computer and one for the player and determine the higher card, then display the two card details (such as Ace – Spades” ) and a message indicating whether the cards are equal, the computer won or the player won (Playing cards are considered equal when they have the same value, no matter what their suit is)
Play 10 rounds of the War game and display a count of the number of times the player wins, the number of times the computer wins, and the number of tie.
Save the game as War.java.
Note: You are encouraged to use predefined methods to organized your War applications.