Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Oct 2012
    Thanked 0 Times in 0 Posts

    Need help on coding!!!

    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
    1 “Ace”
    2 through 10 “2” through “10”
    11 “Jack”
    12 “Queen”
    13 “King”

    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.

  2. #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Saskatoon, Saskatchewan
    Thanked 2,668 Times in 2,637 Posts
    Okay, and what exactly is it you are stuck on?


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts