Question Details

[solution] » public class Koch { // plot Koch curve of order n, with given

Brief item decscription

Step-by-step solution file


Item details:

public class Koch { // plot Koch curve of order n, with given
More:

hello 


I need help on my java assignment. I have two classes which are Turtle and Koch. The required  is a little bit modifying the codes to create a shape of snowflake  as in the attachment . As well as adding some comments to explain the codes . Turtle and Koch classes in the attachments too


public class Koch

 

{

 

// plot Koch curve of order n, with given step size

 

public static void koch(int n, double step, Turtle turtle)

 

{

 

if (n == 0)

 

{

 

turtle.goForward(step);

 

return;

 

}

 

koch(n ­ 1, step, turtle);

 

turtle.turnLeft(60.0);

 

koch(n ­ 1, step, turtle);

 

turtle.turnLeft(­120.0);

 

koch(n ­ 1, step, turtle);

 

turtle.turnLeft(60.0);

 

koch(n ­ 1, step, turtle);

 

}

 

public static void main(String args)

 

{

 

int order = 7;

 

double step = 1.0 / Math.pow(3.0, order);

 

Turtle turtle = new Turtle(0.0, 0.1, 0.0);

 

turtle.penDown();

 

koch(order, step, turtle); }

 

}

 







About this question:
STATUS
Answered
QUALITY
Approved
ANSWER RATING

This question was answered on: Feb 21, 2020

PRICE: $24

Solution~00066502380.zip (18.37 KB)

Buy this answer for only: $24

This attachment is locked

We have a ready expert answer for this paper which you can use for in-depth understanding, research editing or paraphrasing. You can buy it or order for a fresh, original and plagiarism-free copy (Deadline assured. Flexible pricing. TurnItIn Report provided)

Pay using PayPal (No PayPal account Required) or your credit card. All your purchases are securely protected by PayPal.
SiteLock

Need a similar solution fast, written anew from scratch? Place your own custom order

We have top-notch tutors who can help you with your essay at a reasonable cost and then you can simply use that essay as a template to build your own arguments. This we believe is a better way of understanding a problem and makes use of the efficiency of time of the student. New solution orders are original solutions and precise to your writing instruction requirements. Place a New Order using the button below.

Order Now