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.

Create a method int Turtle.java to draw a road pattern horizontally across

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

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!