Intro To Computer Science Quiz #3

11 Questions | Attempts: 85
Share

SettingsSettingsSettings
Computer Science Quizzes & Trivia

Basic java terms, concepts, etc.


Questions and Answers
  • 1. 

    Which of the following are the basic drawing commands?

    • A.

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

    • B.

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

    • C.

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

    • D.

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

    Correct Answer
    C. Forward(); backward(); left(); right();
  • 2. 

    What does the following code create:forward(50);right(90);forward(100);right(90);forward(50);right(90);forward(100);

    Correct Answer
    a rectangle
    1 rectangle
    one rectangle
    rectangle
  • 3. 

    Create the code for making a circle. You must use one of the loop codes.

  • 4. 

    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

    Correct Answer
    D. Nothing
  • 5. 

    What comes at the end of a statement?

    • A.

      Semi-colon

    • B.

      Colon

    • C.

      Curly brace

    • D.

      Parentheses

    Correct Answer
    A. Semi-colon
  • 6. 

    Write the code for making a triangle. You do not need to worry about the angles. Just type in the basic drawing commands.

  • 7. 

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

    Correct Answer
    parentheses
    parenthases
    parenthesis
    parenthasis
  • 8. 

    Which of the following is correct?

    • A.

      SetpenColor(Color.blue)

    • B.

      SetDisplay(Color.orange);

    • C.

      SetDisplayColor(blue);

    • D.

      SetPenColor(Color.pink);

    Correct Answer
    D. SetPenColor(Color.pink);
  • 9. 

    What will happen?The turtle starts at it's original position. A setPosition command is used and nothing else. 

    • 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

    Correct Answer
    C. The turtle will draw a line to the new position
  • 10. 

    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++;}

  • 11. 

    What will happen?for(int i=0; i<4; i++) { forward(50); right(90); }setDisplayColor(Color.blue);

    • 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.

    Correct Answer
    C. You will only see a blue background.

Quiz Review Timeline +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Mar 21, 2022
    Quiz Edited by
    ProProfs Editorial Team
  • Oct 01, 2009
    Quiz Created by
    Kmckenzie29
Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.