java exercise - move 5 times

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • xeltfrjw
    New Member
    • Oct 2008
    • 1

    java exercise - move 5 times

    i have this exercise for class where im supposed to move 5 times. this is what i have so far but im told my another classmate im supposed to write it in code i dono what he means. anyone help?

    this is what i have so far

    [code=java]
    class MoveFiveTimes

    {
    public static void main(String[] args)
    {
    /*
    lower();
    raise();
    move();
    turn();
    circle();
    */
    lower();

    for(int i = 0; i < 5; i++)
    {
    move();
    }
    raise();

    }

    public static void lower()
    {
    System.out.prin tln("lower");

    }
    public static void raise()
    {
    System.out.prin tln("raise");

    }
    public static void move()
    {
    System.out.prin tln("move");

    }
    public static void turn()
    {
    System.out.prin tln("turn");

    }
    public static void circle()
    {
    System.out.prin tln("circle");

    }

    }[/code]
    Last edited by Nepomuk; Oct 16 '08, 11:57 AM. Reason: Added [CODE] tags
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    What are you trying to do here?

    Comment

    • Nepomuk
      Recognized Expert Specialist
      • Aug 2007
      • 3111

      #3
      That code you've posted will just print a few words. If that's all it should do, great, you're done. But I suspect, that there's something, that should be moved. The question is: What are you trying to move?

      Oh, and please use [CODE ... [/CODE] tags when posting code here. I've added them to your post this time.

      Greetings,
      Nepomuk (Moderator)

      Comment

      Working...