Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: about java . the qsn is to move the object to the middle by counting number of steps.

  1. #1
    Junior Member
    Join Date
    Jun 2013
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default about java . the qsn is to move the object to the middle by counting number of steps.



    public class StoneMasonKarel extends SuperKarel {
    public int count=0;
    public void run(){
    countNoOfSteps();
    moveNumberOfSteps();
    }
    public void countNoOfSteps(){
    while(frontIsClear()){
    move();
    count++;
    }
    turnAround();
    }
    public void moveNumberOfSteps(){
    for (int i=0;i= count;i++){
    move();
    putBeeper();
    }
    }

    }
    }


  2. #2
    Member
    Join Date
    May 2011
    Location
    west palm beach, FL
    Posts
    189
    My Mood
    Tired
    Thanks
    41
    Thanked 11 Times in 10 Posts

    Default Re: about java . the qsn is to move the object to the middle by counting number of steps.

    can you please put your code inside code tags and what question are you having?

  3. #3
    Super Moderator jps's Avatar
    Join Date
    Jul 2012
    Posts
    2,642
    My Mood
    Daring
    Thanks
    90
    Thanked 263 Times in 232 Posts

    Default Re: about java . the qsn is to move the object to the middle by counting number of steps.

    Welcome rajbhaumik2010

    You can refer to the Announcements page for help on the use of code tags.

    Also please include a clear question in your future posts

    What does the code do now? Does it compile? Are there any error messages? What trouble are you having in getting Karel to the center?

Similar Threads

  1. Replies: 4
    Last Post: February 24th, 2013, 08:29 PM
  2. Move an object
    By jan4185 in forum What's Wrong With My Code?
    Replies: 4
    Last Post: February 7th, 2013, 02:43 PM
  3. Object Speed problem! (move();)
    By Optimizer in forum What's Wrong With My Code?
    Replies: 9
    Last Post: January 13th, 2013, 06:24 PM
  4. Counting Days problem with object
    By hawkeye10 in forum Object Oriented Programming
    Replies: 3
    Last Post: September 6th, 2012, 09:48 AM
  5. [SOLVED] counting number of comparisons in merge sort
    By mia_tech in forum What's Wrong With My Code?
    Replies: 9
    Last Post: May 26th, 2012, 11:54 PM

Tags for this Thread