Question: Create a method int Turtle.java to draw a road pattern horizontally across the world. The method should take in two parameters, int height that designates
Create a method int Turtle.java to draw a road pattern horizontally across the world. The method should take in two parameters, int height that designates the top edge of the road, and int width that determines the distance between the edges of the road. The dashed lines in the center of the road should be of a length = to of the distance parameter. Center lines should be done with a while loop. The method should deal with errors. If the width is taller than the world, simply print an error and return. If the road drawn at a given y would attempt to draw off of the bottom of the world, the width of the road should be adjusted to fit in the world at the given starting y position.

Please help me!
Thanks in advance! :-)
#java programming
31. Create a method int Turtlejava to draw a "road'' pattern horizontally across the world. The method should take in two parameters. int height that designates the top edge of the road. and int width that determines the distance between the edges of the road. The dashed lines in the center of the road should be of a length F to of the distance parameter. Center lines should be done with a while loop The method should deal with errors. If the width is taller than the world, simply print an error and return. If the road drawn at a given y would attempt to draw off of the bottom ofthe world, the width of the road should be adjusted to fit in the world at the given starting y position
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
