Intro To Computer Science Quiz #3

11 Questions

Settings
Please wait...
Computer Science Quizzes & Trivia

Basic java terms, concepts, etc.


Questions and Answers
  • 1. 
    Create the code for making a circle. You must use one of the loop codes.
  • 2. 
    Write the code for making a triangle. You do not need to worry about the angles. Just type in the basic drawing commands.
  • 3. 
    Explain what the following code will do.int h=0;while(h<10){ for(int i=0; i<4; i++) { forward(50); right(90); } h++;}
  • 4. 
    • A. 

      SetPenWidth(); forward(); backward(); right();

    • B. 

      Forward(); backward(); setHeading(); setPostion();

    • C. 

      Forward(); backward(); left(); right();

    • D. 

      SetPenColor(); backward(); right(); forward();

  • 5. 
    What does the following code create:forward(50);right(90);forward(100);right(90);forward(50);right(90);forward(100);
  • 6. 
    PenUp();forward(100);right(90);forward(50);right(90);forward(100);right(90);forward(50)
    • A. 

      A rectangle

    • B. 

      A square

    • C. 

      Some lines

    • D. 

      Nothing

  • 7. 
    What comes at the end of a statement?
    • A. 

      Semi-colon

    • B. 

      Colon

    • C. 

      Curly brace

    • D. 

      Parentheses

  • 8. 
    What is missing from the following code?for int i=0; i<45; i++{forward(20);left(45);}
  • 9. 
    • A. 

      SetpenColor(Color.blue)

    • B. 

      SetDisplay(Color.orange);

    • C. 

      SetDisplayColor(blue);

    • D. 

      SetPenColor(Color.pink);

  • 10. 
    • A. 

      The turtle will do nothing

    • B. 

      The turtle will move to the new position

    • C. 

      The turtle will draw a line to the new position

  • 11. 
    • A. 

      You will see a square with blue background.

    • B. 

      You will see four squares on a blue background.

    • C. 

      You will only see a blue background.

    • D. 

      Nothing will happen.