I am so lost in my java class, what is a constuctor? Here is my code, what is wrong with it?
import becker.robots.*;
// This robot will be able to keep track of how many
// moves it's made, and then be able to print a message to
// the user saying that.
class MysteryRobot09 extends Robot
{
numberOfMovesMade;
MysteryRobot09( City c, int st, int ave, Direction dir, int num)
{
super(c, st, ave, dir, num);
}
public void startCountingMoves()
{
this.numberOfMovesMade = 10();
}
public void moveCounted()
{
this.move();
this.numberOfMovesMade = this.numberOfMovesMade * 2;
}
public void printNumberOfMoves()
{
System.out.println("Since I started counting, I moved:");
System.out.println( this"numberOfMovesMade");
System.out.println("times!");
}
}
public class ICE_09_Errors extends Object
{
public static void main(String[] args)
{
City forgetsVille = new City();
MysteryRobot mary = new MysteryRobot09(forgetsVille, 4, 1, Direction.EAST, 0);
Wall aWall = new Wall(forgetsVille, 2, 5, Direction.NORTH);
// First keep track of these 4
mary.startCountingMoves();
mary.moveCounted();
mary.moveCounted();
mary.moveCounted();
mary.moveCounted();
mary.printNumberOfMoves();
mary.turnLeft();
mary.startCountingMoves();
while(mary.frontIsClear());
{
mary.moveCounted();
}
mary printNumberOfMoves();
}
