Results 1 to 2 of 2

Thread: Loop help

  1. #1
    antboy333 is offline Member
    Join Date
    Mar 2013
    Posts
    1
    Rep Power
    0

    Default Loop help

    My professor gave me this how do i go about finishing it.
    Make your own Turtle method for drawing a 200 pix. tall two-prong
    fork (or snake's tongue), similar to what's on the cover of this exam. (A2 8)
    Make sure that before returning, your method makes this (a Turtle ) go back to its original location and head pointing direction.
    Your method should begin:
    public void drawFork( )
    { this.forward( 200 ); //You write the rest!
    }
    (B 8) Code a main method that makes a World , then a Turtle in that World ,
    and then uses a loop to draw a circle of 15 forks using the method you have
    made. (360 degrees/15=24 degrees)

    Assume you solved the previous problem correctly. (6) Make a parametrized Turtle
    method with one parameter int nForks . When called, (A 3) it should first print " Hey, I'm going to draw a number of forks on your
    World. " (B 3) Second it should print what number of forks it should draw.
    (C 11) Third , it should use your drawFork method in a loop to make this
    (a Turtle) draw a circle of arrows with nForks, spaced at equal angles. Strategy
    hint: Program it to divide 360 degrees by nForks to calculate how many degrees the
    Turtle should turn after each arrow. In Java, / is the division operator

  2. #2
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    3,501
    Rep Power
    5

    Default Re: Loop help

    First, I have no idea what you are trying to do. Are you new to Java? It sounds like you need to do some graphics. Did you try something on your own yet? Where is the code for your first attempt?

    Regards,
    Jim
    The Java™ Tutorial | SSCCE | Java Naming Conventions
    Poor planning our your part does not constitute an emergency on my part.

Similar Threads

  1. Replies: 2
    Last Post: 11-07-2011, 02:25 AM
  2. Replies: 1
    Last Post: 10-01-2011, 02:12 AM
  3. JTextField loop 2x for-loop WEIRD!
    By Streetproject in forum AWT / Swing
    Replies: 2
    Last Post: 02-16-2011, 05:46 PM
  4. while-loop stopping on first loop
    By davester in forum New To Java
    Replies: 6
    Last Post: 06-26-2009, 08:46 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •