Ok, this is probably like nearer to what you wanted, right?
import java.util.*;
class Robot {
static double locationX, locationY;
static String name;
static...
Type: Posts; User: javapenguin
Ok, this is probably like nearer to what you wanted, right?
import java.util.*;
class Robot {
static double locationX, locationY;
static String name;
static...
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...
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.
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...
Well, you could just ask the user for an x value, store it, then ask for a y value and store it.
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.
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.