Results 1 to 3 of 3
Thread: Help needed
- 12-31-2012, 07:12 PM #1
Member
- Join Date
- Dec 2012
- Posts
- 1
- Rep Power
- 0
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...
- 12-31-2012, 08:52 PM #2
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 CLOSEDWhy do they call it rush hour when nothing moves? - Robin Williams
-
Re: Help needed
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.
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.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.
Consider re-asking your question in the New To Java section and show us some pertinent parts of your work.
Similar Threads
-
Help needed
By ddkm in forum New To JavaReplies: 1Last Post: 02-22-2012, 11:25 PM -
Help Needed
By 7auz in forum EclipseReplies: 1Last Post: 09-30-2010, 05:59 PM -
help needed
By silversurfer2in in forum JDBCReplies: 3Last Post: 05-29-2010, 03:16 PM -
Help needed.
By necro-1000 in forum AWT / SwingReplies: 2Last Post: 01-12-2008, 11:37 AM -
Help Needed
By pks in forum New To JavaReplies: 1Last Post: 01-09-2008, 12:07 AM


LinkBack URL
About LinkBacks


Bookmarks