Results 1 to 5 of 5
  1. #1
    Snejana is offline Member
    Join Date
    Jan 2008
    Posts
    2
    Rep Power
    0

    Unhappy Ah! Help a Java Noob

    Ha I'm so pathetic when it comes to Java, looks like Czech to me :( Well, for a program I'm supposed to test a Fibonacci sequence betting strategy starting at the left of the series (1,1,2,3,5,8..ect). If I win, my bet amount increases by moving 1 up the series and if I lose, I move my betting amount back to the beginning of the series. How on earth am I supposed to store these Fibonacci series numbers (the first 10 or so) and much less test them?!

    Any help is appreciated, seeing as my brain is about to explode =P

  2. #2
    CaptainMorgan's Avatar
    CaptainMorgan is offline Moderator
    Join Date
    Dec 2007
    Location
    NewEngland, US
    Posts
    835
    Rep Power
    8

    Default

    Welcome to the Java Forums Snejana.

    I'm not quite sure I understand your betting strategy... for storing the Fibonacci series - where they are a known quantity, you could just use a standard array. For unknown quantities you might want to look at an ArrayList or some class in the API that adds values to the list as the program runs. Your second question is a little vague... what do you mean by "test"ing them? Do you have a test method? Are you testing the above strategy(which at the moment is still a little unclear)?

    I think you would be well-served if you wrote some psuedocode for your program and/or strategy.

    See you around :)
    Vote for the new slogan to our beloved Java Forums! (closes on September 4, 2008)
    Want to voice your opinion on your IDE/Editor of choice? Vote now!
    Got a little Capt'n in you? (drink responsibly)

  3. #3
    Snejana is offline Member
    Join Date
    Jan 2008
    Posts
    2
    Rep Power
    0

    Default

    Thanks for the welcome =D! I'll take a look at arrays, though I'll probably have no idea what I'm doing haha. As for the second question, once I get the quantities stored I should have no problem figuring it out. Thanks a bunch!

  4. #4
    CaptainMorgan's Avatar
    CaptainMorgan is offline Moderator
    Join Date
    Dec 2007
    Location
    NewEngland, US
    Posts
    835
    Rep Power
    8

    Default

    No problem Snejana. Have you gotten yourself a good book yet? If so, which one? I always recommend Head First Java, by Kathy Sierra and Bert Bates, but there are a number of other great books too. Don't forget to utilize Sun's online tutorials.

    I understand you're new, but I must remind you to review the FAQ section before posting. This isn't a problem at the moment, but please try to use more descriptive titles when posting a thread - this helps us to more efficiently help you. Experienced programmers might not be willing to view a "Noob needs help" thread when instead they might view a "Fibonacci sequence and storage testing" thread because they have experience with that sequence... etc. Something to consider.

    When you get somewhere with your code, please - post back your results if you get stuck. We're here to help. And please remember to use code tags.

    Cheers.
    Last edited by CaptainMorgan; 01-21-2008 at 11:53 PM.
    Vote for the new slogan to our beloved Java Forums! (closes on September 4, 2008)
    Want to voice your opinion on your IDE/Editor of choice? Vote now!
    Got a little Capt'n in you? (drink responsibly)

  5. #5
    gibsonrocker800's Avatar
    gibsonrocker800 is offline Senior Member
    Join Date
    Nov 2007
    Location
    New York
    Posts
    143
    Rep Power
    0

    Default

    I'm having a little bit of trouble understanding what exactly you want. If you want to make a program that finds all Fibonacci numbers up to a certain point, you could do it several ways. I would do it by setting up 3 ints.

    Java Code:
    int a = 0;
    int b = 1;
    int c = a+b;
    And then, you make a for loop that updates the numbers. See if you can figure it out (that is, if this was what you wanted haha).

Similar Threads

  1. Noob
    By nokomis in forum Introductions
    Replies: 2
    Last Post: 03-06-2009, 05:10 PM
  2. [noob]Problem with TOS .bat
    By fred33 in forum Advanced Java
    Replies: 0
    Last Post: 03-19-2008, 02:04 PM

Posting Permissions

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