Which of the following turtle methods affect the color of a turtle drawing? select all that apply.

Class that represents a Logo-style turtle. The turtle starts off facing north. A turtle can have a name, has a starting x and y position, has a heading, has a width, has a height, has a visible flag, has a body color, can have a shell color, and has a pen. The turtle will not go beyond the model display or picture boundaries. You can display this turtle in either a picture or in a class that implements ModelDisplay. Copyright Georgia Institute of Technology 2004

Author:Barb Ericson ericson@cc.gatech.eduConstructor Summarypublic double getDistance(int x, int y)0
          Constructor that takes the x and y position for the turtlepublic double getDistance(int x, int y)1
          Constructor that takes the x and y position and the model displayerpublic double getDistance(int x, int y)2
          Constructor that takes the x and y position and the picture to draw onpublic double getDistance(int x, int y)3
          Constructor that takes a model display and adds a turtle in the middle of itpublic double getDistance(int x, int y)4
          Constructor that takes the picture to draw on and will appear in the middle Method Summarypublic double getDistance(int x, int y)5public double getDistance(int x, int y)6
          Method to go backward by 100 pixelspublic double getDistance(int x, int y)5public double getDistance(int x, int y)8
          Method to go backward a given number of pixelspublic double getDistance(int x, int y)5public void turnToFace(SimpleTurtle turtle)0
          Method to clear the path (history of where the turtle has been)public double getDistance(int x, int y)5public void turnToFace(SimpleTurtle turtle)2
          Method to draw the information stringpublic double getDistance(int x, int y)5public void turnToFace(SimpleTurtle turtle)4
          Method to draw a passed picture at the current turtle location and rotation in a picture or model displaypublic double getDistance(int x, int y)5public void turnToFace(SimpleTurtle turtle)6
          Method to move the turtle foward 100 pixelspublic double getDistance(int x, int y)5public void turnToFace(SimpleTurtle turtle)8
          Method to move the turtle forward the given number of pixelspublic void turnToFace(SimpleTurtle turtle)9public void turnToFace(int x, int y)0
          Method to get the body colorpublic void turnToFace(int x, int y)1public void turnToFace(int x, int y)2
          Get the distance from the passed x and y locationpublic void turnToFace(int x, int y)1public void turnToFace(int x, int y)4
          Method to get the current headingpublic void turnToFace(int x, int y)5public void turnToFace(int x, int y)6
          Method to return the height of this objectpublic void turnToFace(SimpleTurtle turtle)9public void turnToFace(int x, int y)8
          Method to get the information colorpublic void turnToFace(int x, int y)9public Picture getPicture()0
          Method to get the model display for this simple turtlepublic Picture getPicture()1public Picture getPicture()2
          Method to get the name of the turtlepublic Picture getPicture()3public Picture getPicture()4
          Method to get the penpublic void turnToFace(SimpleTurtle turtle)9public Picture getPicture()6
          Method to get the pen colorpublic void turnToFace(int x, int y)5public Picture getPicture()8
          Method to get the pen widthpublic Picture getPicture()9public SimpleTurtle(int x, int y)00
          Method to get the picture for this simple turtlepublic void turnToFace(SimpleTurtle turtle)9public SimpleTurtle(int x, int y)02
          Method to get the shell colorpublic SimpleTurtle(int x, int y)03public SimpleTurtle(int x, int y)04
          Method to get value of show infopublic void turnToFace(int x, int y)5public SimpleTurtle(int x, int y)06
          Method to return the width of this objectpublic void turnToFace(int x, int y)5public SimpleTurtle(int x, int y)08
          Method to get the current x positionpublic void turnToFace(int x, int y)5public SimpleTurtle(int x, int y)10
          Method to get the current y positionpublic double getDistance(int x, int y)5public SimpleTurtle(int x, int y)12
          Method to hide the turtle (stop showing it) This doesn't affect the pen statuspublic SimpleTurtle(int x, int y)03public SimpleTurtle(int x, int y)14
          Method to check if the pen is downpublic SimpleTurtle(int x, int y)03public SimpleTurtle(int x, int y)16
          Method to get the value of the visible flagpublic double getDistance(int x, int y)5public SimpleTurtle(int x, int y)18
          Method to move to turtle to the given x and y locationpublic double getDistance(int x, int y)5public SimpleTurtle(int x, int y)20
          Method to paint the turtlepublic double getDistance(int x, int y)5public SimpleTurtle(int x, int y)22
          Method to set the pen downpublic double getDistance(int x, int y)5public SimpleTurtle(int x, int y)24
          Method to lift the pen uppublic double getDistance(int x, int y)5public SimpleTurtle(int x, int y)26
          Method to set the body color which will also set the pen colorpublic double getDistance(int x, int y)5public SimpleTurtle(int x, int y)28
          Method to set the color of the turtle.public double getDistance(int x, int y)5public SimpleTurtle(int x, int y)30
          Method to set the headingpublic double getDistance(int x, int y)5public SimpleTurtle(int x, int y)32
          Method to set the height of this objectpublic double getDistance(int x, int y)5public SimpleTurtle(int x, int y)34
          Method to set the information colorpublic double getDistance(int x, int y)5public SimpleTurtle(int x, int y)36
          Method to set the model display for this simple turtlepublic double getDistance(int x, int y)5public SimpleTurtle(int x, int y)38
          Method to set the name of the turtlepublic double getDistance(int x, int y)5public SimpleTurtle(int x, int y)40
          Method to set the penpublic double getDistance(int x, int y)5public SimpleTurtle(int x, int y)42
          Method to set the pen colorpublic double getDistance(int x, int y)5public SimpleTurtle(int x, int y)44
          Method to set the pen down boolean variablepublic double getDistance(int x, int y)5public SimpleTurtle(int x, int y)46
          Method to set the pen widthpublic double getDistance(int x, int y)5public SimpleTurtle(int x, int y)48
          Method to set the picture for this simple turtlepublic double getDistance(int x, int y)5public SimpleTurtle(int x, int y)50
          Method to set the shell colorpublic double getDistance(int x, int y)5public SimpleTurtle(int x, int y)52
          Method to show the turtle information stringpublic double getDistance(int x, int y)5public SimpleTurtle(int x, int y)54
          Method to set the visible flagpublic double getDistance(int x, int y)5public SimpleTurtle(int x, int y)56
          Method to set the width of this objectpublic double getDistance(int x, int y)5public SimpleTurtle(int x, int y)58
          Method to show the turtle (doesn't affect the pen statuspublic Picture getPicture()1public SimpleTurtle(int x, int y)60
          Method to return a string with informaiton about this turtlepublic double getDistance(int x, int y)5public SimpleTurtle(int x, int y)62
          Method to turn the turtle the passed degrees use negative to turn left and pos to turn rightpublic double getDistance(int x, int y)5public SimpleTurtle(int x, int y)64
          Method to turn leftpublic double getDistance(int x, int y)5public SimpleTurtle(int x, int y)66
          Method to turn rightpublic double getDistance(int x, int y)5public SimpleTurtle(int x, int y)68
          Method to turn towards the given x and ypublic double getDistance(int x, int y)5public SimpleTurtle(int x, int y)70
          Method to turn to face another simple turtlepublic double getDistance(int x, int y)5public SimpleTurtle(int x, int y)72
          Method to update the display of this turtle and also check that the turtle is in the bounds Methods inherited from class java.lang.Objectpublic SimpleTurtle(int x, int y)73 public SimpleTurtle(int x, int y)Constructor that takes the x and y position for the turtleParameters:public SimpleTurtle(int x, int y)74 - the x pospublic SimpleTurtle(int x, int y)75 - the y pospublic SimpleTurtle(int x, int y, ModelDisplay display)Constructor that takes the x and y position and the model displayerParameters:public SimpleTurtle(int x, int y)74 - the x pospublic SimpleTurtle(int x, int y)75 - the y pospublic SimpleTurtle(int x, int y)78 - the model displaypublic SimpleTurtle(ModelDisplay display)Constructor that takes a model display and adds a turtle in the middle of itParameters:public SimpleTurtle(int x, int y)78 - the model displaypublic SimpleTurtle(int x, int y, Picture picture)Constructor that takes the x and y position and the picture to draw onParameters:public SimpleTurtle(int x, int y)74 - the x pospublic SimpleTurtle(int x, int y)75 - the y pospublic SimpleTurtle(int x, int y)82 - the picture to draw onpublic SimpleTurtle(Picture picture)Constructor that takes the picture to draw on and will appear in the middleParameters:public SimpleTurtle(int x, int y)82 - the picture to draw on

getDistance

public double getDistance(int x, int y)Get the distance from the passed x and y locationParameters:public SimpleTurtle(int x, int y)74 - the x locationpublic SimpleTurtle(int x, int y)75 - the y location

turnToFace

public void turnToFace(SimpleTurtle turtle)Method to turn to face another simple turtle

turnToFace

public void turnToFace(int x, int y)Method to turn towards the given x and yParameters:public SimpleTurtle(int x, int y)74 - the x to turn towardspublic SimpleTurtle(int x, int y)75 - the y to turn towards

getPicture

public Picture getPicture()Method to get the picture for this simple turtleReturns:the picture for this turtle (may be null)

setPicture

public SimpleTurtle(int x, int y)0Method to set the picture for this simple turtleParameters:public SimpleTurtle(int x, int y)88 - the picture to use

getModelDisplay

public SimpleTurtle(int x, int y)1Method to get the model display for this simple turtleReturns:the model display if there is one else null

setModelDisplay

public SimpleTurtle(int x, int y)2Method to set the model display for this simple turtleParameters:public SimpleTurtle(int x, int y)89 - the model display to use

getShowInfo

public SimpleTurtle(int x, int y)3Method to get value of show infoReturns:true if should show info, else false

setShowInfo

public SimpleTurtle(int x, int y)4Method to show the turtle information stringParameters:public SimpleTurtle(int x, int y)90 - the value to set showInfo to

getShellColor

public SimpleTurtle(int x, int y)5Method to get the shell colorReturns:the shell color

setShellColor

public SimpleTurtle(int x, int y)6Method to set the shell colorParameters:public SimpleTurtle(int x, int y)91 - the color to use

getBodyColor

public SimpleTurtle(int x, int y)7Method to get the body colorReturns:the body color

setBodyColor

public SimpleTurtle(int x, int y)8Method to set the body color which will also set the pen colorParameters:public SimpleTurtle(int x, int y)91 - the color to use

setColor

public SimpleTurtle(int x, int y)9Method to set the color of the turtle. This will set the body colorParameters:public SimpleTurtle(int x, int y)91 - the color to use

getInfoColor

public SimpleTurtle(int x, int y, ModelDisplay display)0Method to get the information colorReturns:the color of the information string

setInfoColor

public SimpleTurtle(int x, int y, ModelDisplay display)1Method to set the information colorParameters:public SimpleTurtle(int x, int y)91 - the new color to use

getWidth

public SimpleTurtle(int x, int y, ModelDisplay display)2Method to return the width of this objectReturns:the width in pixels

getHeight

public SimpleTurtle(int x, int y, ModelDisplay display)3Method to return the height of this objectReturns:the height in pixels

setWidth

public SimpleTurtle(int x, int y, ModelDisplay display)4Method to set the width of this objectParameters:public SimpleTurtle(int x, int y)95 - in width in pixels

setHeight

public SimpleTurtle(int x, int y, ModelDisplay display)5Method to set the height of this objectParameters:public SimpleTurtle(int x, int y)96 - the height in pixels

getXPos

public SimpleTurtle(int x, int y, ModelDisplay display)6Method to get the current x positionReturns:the x position (in pixels)

getYPos

public SimpleTurtle(int x, int y, ModelDisplay display)7Method to get the current y positionReturns:the y position (in pixels)

getPen

public SimpleTurtle(int x, int y, ModelDisplay display)8Method to get the penReturns:the pen

setPen

public SimpleTurtle(int x, int y, ModelDisplay display)9Method to set the penParameters:public SimpleTurtle(int x, int y)97 - the new pen to use

isPenDown

public SimpleTurtle(ModelDisplay display)0Method to check if the pen is downReturns:true if down else false

setPenDown

public SimpleTurtle(ModelDisplay display)1Method to set the pen down boolean variableParameters:public SimpleTurtle(int x, int y)90 - the value to set it to

penUp

public SimpleTurtle(ModelDisplay display)2Method to lift the pen up

penDown

public SimpleTurtle(ModelDisplay display)3Method to set the pen down

getPenColor

public SimpleTurtle(ModelDisplay display)4Method to get the pen colorReturns:the pen color

setPenColor

public SimpleTurtle(ModelDisplay display)5Method to set the pen colorParameters:public SimpleTurtle(int x, int y)91 - the color for the pen ink

setPenWidth

public SimpleTurtle(ModelDisplay display)6Method to set the pen widthParameters:public SimpleTurtle(int x, int y, ModelDisplay display)00 - the width to use in pixels

getPenWidth

public SimpleTurtle(ModelDisplay display)7Method to get the pen widthReturns:the width of the pen in pixels

clearPath

public SimpleTurtle(ModelDisplay display)8Method to clear the path (history of where the turtle has been)

getHeading

public SimpleTurtle(ModelDisplay display)9Method to get the current headingReturns:the heading in degrees

setHeading

public SimpleTurtle(int x, int y, Picture picture)0Method to set the headingParameters:public SimpleTurtle(int x, int y, ModelDisplay display)01 - the new heading to use

getName

public SimpleTurtle(int x, int y, Picture picture)1Method to get the name of the turtleReturns:the name of this turtle

setName

public SimpleTurtle(int x, int y, Picture picture)2Method to set the name of the turtleParameters:public SimpleTurtle(int x, int y, ModelDisplay display)02 - the new name to use

isVisible

public SimpleTurtle(int x, int y, Picture picture)3Method to get the value of the visible flagReturns:true if visible else false

hide

public SimpleTurtle(int x, int y, Picture picture)4Method to hide the turtle (stop showing it) This doesn't affect the pen status

show

public SimpleTurtle(int x, int y, Picture picture)5Method to show the turtle (doesn't affect the pen status

setVisible

public SimpleTurtle(int x, int y, Picture picture)6Method to set the visible flagParameters:public SimpleTurtle(int x, int y)90 - the value to set it to

updateDisplay

public SimpleTurtle(int x, int y, Picture picture)7Method to update the display of this turtle and also check that the turtle is in the bounds

forward

public SimpleTurtle(int x, int y, Picture picture)8Method to move the turtle foward 100 pixels

forward

public SimpleTurtle(int x, int y, Picture picture)9Method to move the turtle forward the given number of pixelsParameters:public SimpleTurtle(int x, int y, ModelDisplay display)04 - the number of pixels to walk forward in the heading direction

backward

public SimpleTurtle(Picture picture)0Method to go backward by 100 pixels

backward

public SimpleTurtle(Picture picture)1Method to go backward a given number of pixelsParameters:public SimpleTurtle(int x, int y, ModelDisplay display)04 - the number of pixels to walk backward

moveTo

public SimpleTurtle(Picture picture)2Method to move to turtle to the given x and y locationParameters:public SimpleTurtle(int x, int y)74 - the x value to move topublic SimpleTurtle(int x, int y)75 - the y value to move to

turnLeft

public SimpleTurtle(Picture picture)3Method to turn left

turnRight

public SimpleTurtle(Picture picture)4Method to turn right

turn

public SimpleTurtle(Picture picture)5Method to turn the turtle the passed degrees use negative to turn left and pos to turn rightParameters:public SimpleTurtle(int x, int y, ModelDisplay display)08 - the amount to turn in degrees

drop

public SimpleTurtle(Picture picture)6Method to draw a passed picture at the current turtle location and rotation in a picture or model displayParameters:public SimpleTurtle(int x, int y, ModelDisplay display)09 - the picture to drop

paintComponent

public SimpleTurtle(Picture picture)7Method to paint the turtleParameters:public SimpleTurtle(int x, int y, ModelDisplay display)10 - the graphics context to paint on

drawInfoString

public SimpleTurtle(Picture picture)8Method to draw the information stringParameters:public SimpleTurtle(int x, int y, ModelDisplay display)10 - the graphics context

toString

public SimpleTurtle(Picture picture)9Method to return a string with informaiton about this turtleReturns:a string with information about this object

What changes the color of the turtle arrow?

color() This method is used to change the color of the turtle. The default color is black.

Which of the following turtle methods lets you change the background color of the screen?

bgcolor() This method is used to set or return background color of the Turtle Screen.

What are the methods of a turtle?

Overview of available Turtle and Screen methods.
forward() | fd().
backward() | bk() | back().
right() | rt().
left() | lt().
goto() | setpos() | setposition().
setheading() | seth().

Which command is used to set color in shaped turtles?

fillcolor(): This helps to choose the color for filling the shape. It takes the input parameter as the color name or hex value of the color and fills the upcoming closed geographical objects with the chosen color. Color names are basic color names i.e. red, blue, green, orange.

Chủ đề