0

objective: Write a class Bug that models a bug moving along a horizontal line. The bug moves either to the right of to the left. Initially, the bug moves to the right, but it can turn to change its direction. Provide a constructor. All methods are included below.

public class Bug {

    public Bug(int initial position)
    {
    	position= initialPosition;
    }
    public void turn();
    {
    	double newOrientation = count* -1;
    }
    public void move();
    {

    }
    public int getPosition();

    


}
4
Contributors
6
Replies
7
Views
6 Years
Discussion Span
Last Post by mrjillberth
0

??? Are you doing GUI? Or are you displaying out on a console??? Also, you need to implement as well, not just a skeleton like this with nothing to help understanding at all...

0

So how would you test the Bug class then? What does your sample test look like?

Edited by Taywin: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.