Search:

Type: Posts; User: javapenguin

Search: Search took 0.09 seconds.

  1. Replies
    15
    Views
    4,100

    Re: Trouble with getX() and getY()

    Ok, this is probably like nearer to what you wanted, right?


    import java.util.*;

    class Robot {
    static double locationX, locationY;
    static String name;
    static...
  2. Replies
    15
    Views
    4,100

    Re: Trouble with getX() and getY()

    I've gotten it this far, though I've no idea what you plan to do with the variable currentLocation;

    As it is, it will compile, but nothing in the direction will change.

    I can't get any further...
  3. Replies
    15
    Views
    4,100

    Re: Trouble with getX() and getY()

    Also, you can use double values as input, just so long as you use two of them.

    I'm working on the code right now to fix it.
  4. Replies
    15
    Views
    4,100

    Re: Trouble with getX() and getY()

    Also, your moveForeward() and turnLeft() methods should probably be void methods according to the comments before the methods.

    The method isn't returning any value though you have set the return...
  5. Replies
    15
    Views
    4,100

    Re: Trouble with getX() and getY()

    Well, you could just ask the user for an x value, store it, then ask for a y value and store it.
  6. Replies
    15
    Views
    4,100

    Re: Trouble with getX() and getY()

    Yep, confirmed that there's no Double method called getX().

    Just tried it in a test sample and got the "double cannot be dereferenced" thing too.
  7. Replies
    15
    Views
    4,100

    Re: Trouble with getX() and getY()

    I can't find a getX() method for the primitive type double.

    Also, I wonder if it's an integer/double mixup.

    Am looking at it now.
Results 1 to 7 of 7