Excercise #5

Status
Nicht offen für weitere Antworten.
G

Guest

Gast
Code:
import TurtleGraphics.StandardPen;
import TerminalIO.KeyboardReader;

public class cag01 {
    public static void main (String [] args) {


KeyboardReader reader = new KeyboardReader();

       // Instantiate a pen object
       StandardPen pen = new StandardPen ();

       // Lift the pen, move it to the square's top left corner,
       // and lower it again
       pen.up();
       pen.move(25);
       pen.turn(90); pen.move (25);
       pen.down();
       System.out.print ("Enter 1 to draw a square ") ;
       
       // Draw the square
        pen.turn(90); pen.move(50);
        pen.turn(90); pen.move(50);
        pen.turn(90); pen.move(50);
        pen.turn(90); pen.move(50);
        pen.turn(90); pen.move(50);
        
       }
   }
 
G

Gast

Gast
Code:
import TurtleGraphics.StandardPen;
import TerminalIO.KeyboardReader;

public class cag01 {
    public static void main (String [] args) {


KeyboardReader reader = new KeyboardReader();
       int one;
       

       // Instantiate a pen object
       StandardPen pen = new StandardPen ();

       // Lift the pen, move it to the square's top left corner,
       // and lower it again
       pen.up();
       pen.move(25);
       pen.turn(90); pen.move (25);
       pen.down();
       System.out.println ("Enter 1 to draw a square ") ;
       one=reader.readInt(); 
       // Draw the square
        pen.turn(90); pen.move(50);
        pen.turn(90); pen.move(50);
        pen.turn(90); pen.move(50);
        pen.turn(90); pen.move(50);
        pen.turn(90); pen.move(50);
        
       }
   }
       
       // Lift the pen, move it to the top of the circle,
       // and lower it again
       pen.up();
       pen.move(25);
       pen.turn(90); pen.move (0.8);
       pen.down();

      //Draw the 100gon
       for (i = 1; i <= 100; i++){
            pen.turn (3.6);
            pen.move (1.6);
         }
       }
    }
 
B

Beni

Gast
a) werden hier keine Hausaufgaben gelöst (no Excercises are solved in this Board)
b) solltest du schon erklären, was du überhaupt willst, wo dein Problem ist (you should explan, what you want, and where the problem is)

* closed *
 
Status
Nicht offen für weitere Antworten.

Neue Themen


Oben