Results 1 to 3 of 3

Thread: Help needed

  1. #1
    june1958 is offline Member
    Join Date
    Dec 2012
    Posts
    1
    Rep Power
    0

    Default Help needed

    Hey, I need some help with a project that is due really soon

    My project is to "write code for a class called Deck (may need other classes for your implementation as well). "
    basically i have to create a deck of cards and be able to shuffle it and sort it as well. The problem is for sorting the deck, clubs should be considered the lowest suit and hence it should be sorted into the lowest indicies (i don't know how to make one String "lower" than another)

    Also, I have created a card class and a deck class but i don't know how to relate them.

    Highly appreciate your help...

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,423
    Rep Power
    20

    Default Re: Help needed

    This isn't a homework service, and this section is for introductions. I'm closing this thread as off-topic.

    db

    THREAD CLOSED
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default Re: Help needed

    Quote Originally Posted by june1958 View Post
    Hey, I need some help with a project that is due really soon
    Leave this part out of your question since it only affects you and will have no bearing on the help you may or may not receive here.

    My project is to "write code for a class called Deck (may need other classes for your implementation as well). "
    basically i have to create a deck of cards and be able to shuffle it and sort it as well. The problem is for sorting the deck, clubs should be considered the lowest suit and hence it should be sorted into the lowest indicies (i don't know how to make one String "lower" than another)

    Also, I have created a card class and a deck class but i don't know how to relate them.
    There are some good examples of creating a Card class using enums for the suits and values that you can find with Google. As for sorting, consider making your Card implement Comparable<Card> and in the compareTo method use the suit and value both to figure out what value to return, 1, 0, or -1.

    Consider re-asking your question in the New To Java section and show us some pertinent parts of your work.

Similar Threads

  1. Help needed
    By ddkm in forum New To Java
    Replies: 1
    Last Post: 02-22-2012, 11:25 PM
  2. Help Needed
    By 7auz in forum Eclipse
    Replies: 1
    Last Post: 09-30-2010, 05:59 PM
  3. help needed
    By silversurfer2in in forum JDBC
    Replies: 3
    Last Post: 05-29-2010, 03:16 PM
  4. Help needed.
    By necro-1000 in forum AWT / Swing
    Replies: 2
    Last Post: 01-12-2008, 11:37 AM
  5. Help Needed
    By pks in forum New To Java
    Replies: 1
    Last Post: 01-09-2008, 12:07 AM

Posting Permissions

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