Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > Java Basics
|
Java Basics General beginning Java language questions that don't fit in one of the more specific forums. Please specify what version.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Java Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 19th, 2006, 12:59 AM
Registered User
 
Join Date: Oct 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to ToniDe Send a message via Yahoo to ToniDe
Default Fine Tunning a Program

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.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Tunning Through Forms 6i Malan_72 Oracle 2 July 1st, 2006 12:42 AM
SP Returns Nothing but runs fine...help [email protected] SQL Server 2000 1 May 15th, 2006 05:55 AM
Everything builds fine, but Server cannot access.. rellsbu BOOK: ASP.NET Website Programming Problem-Design-Solution 4 November 3rd, 2005 09:20 AM
code behind fine missing CHen VS.NET 2002/2003 0 March 4th, 2005 03:25 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.