@@ -0,0 +1,882 @@
+%0A%0Apublic class Robot1 %7B%0A%09private double batteryCharge = 5.0; // instance variable%0A%0A%09// Instance Method #1 - Recharges the battery of the robot%0A%09public void batteryReCharge(double c) %7B%0A%09%09this.batteryCharge += c;%0A%09%09System.out.println(%22Battery charge is: %22 + this.batteryCharge);%0A%09%7D%0A%09%0A%09// Instance Method #2 - Moves the robot and prints out movement%0A%09public void move(int distance) %7B%0A%09%09for ( int i = 1; i %3C= distance; i++)%7B%0A%09%09%09if (this.batteryCharge %3E= 0.5)%7B%0A%09%09%09%09System.out.print(%22%5B%22 + i + %22%5D %22);%0A%09%09%09%09this.batteryCharge -= 0.5;%0A%09%09%09%7D%0A%09%09%09else%7B%0A%09%09%09%09System.out.println(%22Out of power!%22);%0A%09%09%09%7D%0A%09%09%7D%09%0A%09%7D%0A%0A%09public static void main(String%5B%5D args) %7B%0A%09%09Robot1 r = new Robot1(); // start off with a well-charged battery%0A%09%09r.move(11); // move around and use up the charge%0A%09%09r.batteryReCharge(2.5); // get a new charge%0A%09%09r.batteryReCharge(0.5); // add a bit more%0A%09%09r.move(5); // move some more%0A%0A%09%7D%0A%7D%0A

Create Robot1.java