Question: Your task is to write a tester for a class Bug that models a bug climbing up a pole. Each time the climb method is

Your task is to write a tester for a class Bug that models a bug climbing up a pole. Each time the climb method is called, the bug climbs by a given number of centimeters. Whenever it reaches the top of the pole (at 100cm), it slides back to the bottom. Your tester should verify that the bug slides back to the bottom. Use all lines.
How to use this tool
Unused
System. out.println(bugsy.getPosition());
bugsy. climb (40);
System.out.println("Expected: 40");
System.out.println(bgsy.getPosition());
System. out.println(bugsy.getPosition());
bugsy.climb(50);
System.out.println("Expected: 90");
bugsy. climb(20);
Bug bugsy = new Bug();
BugTester.java hat(grad)
Load default template...
public class BugTester
{
public static void main (String [] args)
{
System. out.println("Expected: 0");
}
}
}
System.out.printin("Expected: 0");
}
Your task is to write a tester for a class Bug that models a bug climbing up a pole. Each time the climb method is called, the bug that the bug slides back to the bottom. Use all lines.
System. out.print ln(bugsy.getPosition());
bugsy.climb(40); System.out.println("Expected: 40"); System. out.println(bgsy.getPosition()); System. out.println(bugsy.getPosition());
bugsy.climb(50);
bugsy. climb(20);
Bug bugsy = new Bug();
 Your task is to write a tester for a class Bug

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!