Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 7 of 7

Thread: Noob needs a bit of help

  1. #1
    Junior Member
    Join Date
    Dec 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Noob needs a bit of help

    Evening all.

    Need a bit of help with some code im trying to sort for college.

    Now, go easy on me, im new to all this stuff

    I need a for- if statement to determine which month in a year has the highest levels of rainfall, but i can figure out whats wrong with this

    It also needs to do it for minimum but ill be able to sort that once i figure out this one

    Heres the code

    public static void maximium (double[] months)
    {
    int highpos;
    (highpos)=0;
    for (int i = 1; i<11; i++)
    if (months[i]> months [highpos]
    {
    highpos=i;
    }


    Thats not it all, thats just the relevant section.

    Tanks in advance

    Chris


  2. #2
    Super Moderator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,104
    Thanks
    169
    Thanked 780 Times in 726 Posts
    Blog Entries
    5

    Default Re: Noob needs a bit of help

    but i can figure out whats wrong with this
    You need to help us out by telling us what's wrong with it. Does it compile? Exception? Misbehave? Please see the link in my signature entitled "Getting Help"

  3. #3
    Junior Member
    Join Date
    Dec 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Noob needs a bit of help

    Quote Originally Posted by copeg View Post
    You need to help us out by telling us what's wrong with it. Does it compile? Exception? Misbehave? Please see the link in my signature entitled "Getting Help"
    As i said, noob lol.

    It runs the first part of the program, but once it reaches that bit of code, it just stops?? If that makes sense??

  4. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    18,646
    Thanks
    45
    Thanked 1,959 Times in 1,933 Posts

    Default Re: Noob needs a bit of help

    There are several types of "stops". Does the program print an error message and exit.
    Does the program spin in a loop requiring you to do something to have it end.

    Can you explain what happens?

    thats just the relevant section.
    How do you know what part of the program is the relevant section?

  5. #5
    Junior Member
    Join Date
    Dec 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Noob needs a bit of help

    Im writing this in eclipse and it shows where the errors come up, but i dont know what they are. It doesnt print an error message.

    This part of the code was put in between 2 other bits, both of which were working before. Now it stops at this for statement??

  6. #6
    Member Emperor_Xyn's Avatar
    Join Date
    Dec 2011
    Posts
    66
    My Mood
    Devilish
    Thanks
    21
    Thanked 2 Times in 2 Posts

    Default Re: Noob needs a bit of help

    What does the error say?? The errors help you know what's wrong with your code. But we need to know exactly.

  7. #7
    Super Moderator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,104
    Thanks
    169
    Thanked 780 Times in 726 Posts
    Blog Entries
    5

    Default Re: Noob needs a bit of help

    And I again recommend reading the Getting Help link in my signature. Things like being as descriptive as possible, posting full error messages, and posting an SSCCE will help us all get on the same page, and will help you receive help.

Similar Threads

  1. Most noob question ever.
    By SkyAphid in forum Java Theory & Questions
    Replies: 1
    Last Post: December 8th, 2011, 07:14 AM
  2. NOOB problem here.
    By Nemus in forum What's Wrong With My Code?
    Replies: 3
    Last Post: November 13th, 2011, 07:13 AM
  3. Noob needs help!
    By kram in forum What's Wrong With My Code?
    Replies: 1
    Last Post: November 2nd, 2011, 05:03 AM
  4. NOOB: Array Help
    By DEAF in forum What's Wrong With My Code?
    Replies: 3
    Last Post: October 30th, 2011, 08:39 PM
  5. Programming noob here, need help!
    By artenuga54 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: September 18th, 2010, 04:04 PM