Question: import java.util. * ; import java.awt. * ; public class CustomTurtleRunner { public static void main ( String [ ] args ) { World world
import java.util.;
import java.awt.;
public class CustomTurtleRunner
public static void mainString args
World world new World;
Change the constructor call below to create a large
x CustomTurtle with a green body Colorgreen
and a blue shell Colorblue at position
Move it forward to see it
CustomTurtle turtle new CustomTurtleworldColor.green,Color.blue,;
turtleforward;
Create a small x CustomTurtle with a red body
and a yellow shell at position
Move it forward to see it
CustomTurtle turtle new CustomTurtle world Color.red, Color.yellow,;
turtleforward;
Create a CustomTurtle of your own design
CustomTurtle turtle new CustomTurtle world Color.red, Color.pink, ;
turtlesetPenWidth;
turtleturnRight;
turtleforward;
turtleturnLeft;
turtleforward;
turtleturnLeft;
turtleforward;
turtleturnLeft;
turtleforward;
turtleturnRight;
turtleforward;
turtleturnRight;
turtleforward;
turtleturnRight;
turtleforward;
turtleturnLeft;
turtleforward;
turtleturnLeft;
turtleforward;
turtleturnLeft;
turtleforward;
turtleturnRight;
turtleforward;
turtleturnRight;
turtleforward;
turtleturnRight;
turtleforward;
turtleturnLeft;
turtleforward;
turtleturnLeft;
turtleforward;
turtleturnLeft;
turtleforward;
worldshowtrue;
class CustomTurtle extends Turtle
private int x;
private int y;
private World w;
private Color bodycolor;
private Color shellcolor;
private int width;
private int height;
Constructor that takes the model display
@param modelDisplay the thing that displays the model or world
public CustomTurtleModelDisplay modelDisplay
let the parent constructor handle it
supermodelDisplay;
Constructor that takes the model
display to draw it on and custom colors and size
@param m the world
@param body : the body color
@param shell : the shell color
@param w: width
@param h: height
public CustomTurtleModelDisplay m Color body, Color shell, int w int h
let the parent constructor handle it
superm;
bodycolor body;
setBodyColorbody;
shellcolor shell;
setShellColorshell;
height h;
width w;
setHeighth;
setWidthw;
Constructor that takes the x and y and a model
display to draw it on and custom colors and size
@param x the starting x position
@param y the starting y position
@param m the world
@param body : the body color
@param shell : the shell color
@param w: width
@param h: he
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
