Search:

Type: Posts; User: GregBrannon

Search: Search took 0.11 seconds.

  1. Thread: Distance

    by GregBrannon
    Replies
    22
    Views
    1,353

    [SOLVED] Re: Distance

    You're done? Congrats. Hope I helped, glad if I did.

    Online 24 hrs? No. And if I'm ever getting in the way, just PM me or post for all to see that I should butt out. (That's an idiom for...
  2. Thread: Distance

    by GregBrannon
    Replies
    22
    Views
    1,353

    [SOLVED] Re: Distance

    These are simple fixes, so don't get discouraged.

    For the first, "variable i is already defined," there can only be one variable with the same name in the same "scope." You have nested for loops,...
  3. Thread: Distance

    by GregBrannon
    Replies
    22
    Views
    1,353

    [SOLVED] Re: Distance

    What? All 18 lines?

    I wouldn't describe it as a huge loss, but there's much to be learned by fixing the mistakes you have in the 18 lines of code you've posted or the fewer mistakes that exist in...
  4. Thread: Distance

    by GregBrannon
    Replies
    22
    Views
    1,353

    [SOLVED] Re: Distance

    Nope. You still can't easily see that the last statement is outside any method. Look at the way mine is formatted.
  5. Thread: Distance

    by GregBrannon
    Replies
    22
    Views
    1,353

    [SOLVED] Re: Distance

    You have two local variables named 'c', (lousy name, by the way - give your variables better names, even if they are foreign to us).

    Either your code is poorly formatted to begin with, or it...
  6. Thread: Distance

    by GregBrannon
    Replies
    22
    Views
    1,353

    [SOLVED] Re: Distance

    I'm not sure what you're not getting (be specific), but here's a simple runnable example of what I described. You should be able to find similar examples in your text book, class notes, or online,...
  7. Thread: Distance

    by GregBrannon
    Replies
    22
    Views
    1,353

    [SOLVED] Re: Distance

    Of course you do:

    int N = Integer.parseInt(args[0]);
    edean_distance = Math.sqrt(distance);

    are both calling methods outside main(). Those calls are to static methods in other classes, so...
  8. Thread: Distance

    by GregBrannon
    Replies
    22
    Views
    1,353

    [SOLVED] Re: Distance

    This program has other problems, likely more significant than the one related to the error you posted, but here's why you've gotten that error:

    Sum, which by Java naming convention should be...
Results 1 to 8 of 8