User Profile

Collapse

Profile Sidebar

Collapse
cerise
cerise
Last Activity: Feb 27 '08, 05:01 AM
Joined: Dec 29 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • creating a stack of objects with proper constructors?

    I'm using a Linked list stack with objects. I figured out the reason for my earlier problem (where I couldn't access "rank" and "suit" from one of the objects in my stack), and it was because my object didn't have the attributes "rank" and "suit". Turns out my earlier cards were practically just strings. Can anyone help me create a whole deck of cards represented by 52 objects in a linked list stack with the...
    See more | Go to post

  • cerise
    replied to How to randomize?
    in Java
    Thank you everyone for your very helpful replies. ^^ I was able to shuffle the cards now using the shuffle() algorithm. Our instructor accepted this method of shuffling the cards since the overall project is solitaire.
    See more | Go to post

    Leave a comment:


  • cerise
    replied to i am a java beginner
    in Java
    Again, I apologize. I've read all the guidelines now, and I'll be sure to remember the guidelines the next time....
    See more | Go to post

    Leave a comment:


  • cerise
    replied to How to randomize?
    in Java
    Thank you. ^_^ But I'm pretty sure you haven't given me this tip yet, as it is the first time I've read or heard of it....
    See more | Go to post

    Leave a comment:


  • cerise
    replied to i am a java beginner
    in Java
    I'm sorry, was I not supposed to do that? :( I'll remember the next time.

    And can you tell me what an OP is?...
    See more | Go to post

    Leave a comment:


  • cerise
    replied to i am a java beginner
    in Java
    It simply prints the multiplication table of 10. Its output would be:

    Hello, World

    10 x 0 = 0
    10 x 1 = 10
    10 x 2 = 20
    10 x 3 = 30
    10 x 4 = 40
    10 x 5 = 50
    10 x 6 = 60
    10 x 7 = 70
    10 x 8 = 80
    10 x 9 = 90

    The int variable i are the numbers which are being multiplied to 10. The value of the variable i rises because of the step expression...
    See more | Go to post

    Leave a comment:


  • cerise
    replied to How to randomize?
    in Java
    I've figured out how to use Math.random() package, but is there a way to make the generated numbers unique? For example, I only need numbers from 0 to 51. Can you tell me how I generate one random number only once so that in the end, it seems like I'm rearranging the numbers 0 to 51 in a random sequence?...
    See more | Go to post

    Leave a comment:


  • cerise
    replied to how to use multiple stacks?
    in Java
    oh wait, so does that mean I'm creating the stacks properly? (Sorry, I'm being completely difficult. I only have little idea of what I'm doing.)...
    See more | Go to post

    Leave a comment:


  • cerise
    replied to how to use multiple stacks?
    in Java
    oh gosh, I'm so sorry, I'm a total noob. I had thought that what I posted was my card class, and I also didn't post any main method. was I doing it completely wrong? I'm really sorry....
    See more | Go to post

    Leave a comment:


  • cerise
    replied to how to use multiple stacks?
    in Java
    oh, unfortunately,w e're actually required to use the stacks. is there any way you can help me out with that?...
    See more | Go to post

    Leave a comment:


  • cerise
    started a topic how to use multiple stacks?
    in Java

    how to use multiple stacks?

    I can't figure out how to make and handle multiple stacks and use them so I could create four linked list stacks representing each suit of cards, one stack each for diamonds, hearts, spades, and clubs. I use objects as my cards. I don't know how to make more than one stack.

    Can anyone help me out? If I'm not being clear, I'll be happy to clarify the problem I have.


    here is the class I used to make the Objects...
    See more | Go to post

  • cerise
    replied to "cannot be applied to ()" error?
    in Java
    Thank you SO MUCH. It's compiling fine now....
    See more | Go to post

    Leave a comment:


  • cerise
    started a topic "cannot be applied to ()" error?
    in Java

    "cannot be applied to ()" error?

    I'm trying to make an object to represent a single playing card. Like if it's an EIGHT of HEARTS, the object should be "8 H". Here is what I came up with, but I keep getting the error message,
    "DisplayDeck.ja va:12: switchRank(int) in DisplayCards cannot be applied to ()
    sRank = dispCards.switc hRank();" .
    The error points out the dot in "dispCards.switchRank()".

    Can...
    See more | Go to post

  • cerise
    replied to How to randomize?
    in Java
    Okay, thanks very much. I'll try it and post what I come up with as soon as I can, because as of yet I still haven't figured out how to make the objects (cards)....
    See more | Go to post

    Leave a comment:


  • cerise
    started a topic How to randomize?
    in Java

    How to randomize?

    I'm just starting learning Java, and we have a project that needs to demonstrate shuffling playing cards. We're using objects as our playing cards, and we've put these objects in stacks, and I wonder if anyone can help me how to "shuffle" these objects or put them in a random arrangement?
    See more | Go to post
No activity results to display
Show More
Working...