# Ics Practice Quiz 2 - Java

Approved & Edited by ProProfs Editorial Team
The editorial team at ProProfs Quizzes consists of a select group of subject experts, trivia writers, and quiz masters who have authored over 10,000 quizzes taken by more than 100 million users. This team includes our in-house seasoned quiz moderators and subject matter experts. Our editorial experts, spread across the world, are rigorously trained using our comprehensive guidelines to ensure that you receive the highest quality quizzes.
| By Aishamo
A
Aishamo
Community Contributor
Quizzes Created: 3 | Total Attempts: 19,220
Questions: 11 | Attempts: 157

Settings

Introduction to Computer Science practice java quiz

• 1.

### 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

C. The turtle will draw a line to the new position
Explanation
The turtle will always leave a mark when it moves unless you use penUp() and penDwn().

Rate this question:

• 2.

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

C. You will only see a blue background.
Explanation
Since setDisplayColor came after the loop (that created a square) it places a block of color over whatever was drawn beforehand. You need to place setDisplayColor first.

Rate this question:

• 3.

• 4.

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

rectangle
a rectangle
Explanation
a rectangle

Rate this question:

• 5.

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

parentheses
the opening and closing parentheses
()
Explanation
Its missing the parentheses around the while's true/false statement: while(i

Rate this question:

• 6.

### Which of the following is correct

• A.

SetpenColor(Color.blue)

• B.

SetDisplay(Color.orange);

• C.

SetDisplayColor(blue);

• D.

SetPenColor(Color.gray);

D. SetPenColor(Color.gray);
Explanation
A) the P in not capitalized
B) Color is missing in setDisplayColor
C) Color is missing in Color.blue

Rate this question:

• 7.

### Which of the following are the basic drawing commands?

• A.

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

• B.

• C.

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

• D.

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

C. Forward(); backward(); left(); right();
Explanation
The basic drawing commands are the actions that allow the user to move the pen in different directions and change its position. The commands "forward()" and "backward()" are used to move the pen forward or backward, while "left()" and "right()" are used to rotate the pen in the respective directions. These commands are essential for creating different shapes and patterns in a drawing.

Rate this question:

• 8.

### What does this create?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

D. Nothing
Explanation
The penUp makes the turtle not leave any marks

Rate this question:

• 9.

### What comes at the end of a command?

• A.

Semi-colon

• B.

Colon

• C.

Curly bracket / brace

• D.

Parentheses

A. Semi-colon
Explanation
every command ends with a semicolon

Rate this question:

• 10.

• 11.

Related Topics