Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_step_2

Step: 3

blur-text-image_step3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Database Management Systems

Authors: Patricia Ward, George A Dafoulas

1st Edition

ISBN: 1844804526, 978-1844804528

More Books

Students also viewed these Databases questions