The Question
http://www.freewebs.com/tonide/Question5.mht
My Coding
http://www.freewebs.com/tonide/Pentagram.mht
import TurtleGraphics.*;
import static java.lang.Math.*;
public class Pentagram {
private Turtle jay;
private Pentagram() {
int r;
jay = new Turtle();
jay.forward(55);
jay.penDown();
jay.right(7*PI/10);
for (r=80; r<=84; r++){
jay.forward(2*80*sin(PI/5));
jay.right(2*PI/5);
};
jay.right(2*PI/10);
for (r=80; r<=84; r++){
= jay.forward(2*80*cos(PI/10));
= jay.right(4*PI/5);
};
jay.penUp();
jay.left(9*PI/10);
jay.backward(55);
};=
public static void main (String[] args) {new Pentagram(); };
I was suppose to go by the instructions in the question but am not quite sure how to get it done properly.
the [private void draw pent...]. I don't fully understand it and there's no way I could get help from my prof before my exam so I just need someone to point me in the right direction so when I do my practical I would know how to work with the void...
Can someone tell me how to redo this with those methods as I cannot get it to run with.