JavaScript Graphics

JavaScript Graphics

9th - 12th Grade

10 Qs

quiz-placeholder

Similar activities

Server Administration- Quiz 1

Server Administration- Quiz 1

12th Grade - University

10 Qs

Quiz 9 (15.09.2021)

Quiz 9 (15.09.2021)

1st - 12th Grade

10 Qs

Technology Week HTG Quiz - Monday

Technology Week HTG Quiz - Monday

7th - 12th Grade

10 Qs

Thinglink

Thinglink

9th - 12th Grade

10 Qs

Recording Software Button Identification Quiz

Recording Software Button Identification Quiz

8th Grade - University

10 Qs

Databases

Databases

11th Grade

15 Qs

Python Level 3 - Minecraft

Python Level 3 - Minecraft

5th - 12th Grade

11 Qs

11° Evaluación bimestral de informática

11° Evaluación bimestral de informática

11th Grade

15 Qs

JavaScript Graphics

JavaScript Graphics

Assessment

Quiz

Computers

9th - 12th Grade

Medium

Created by

Mrs. Shah

Used 31+ times

FREE Resource

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In a graphics canvas, what are the coordinates of the bottom right corner of the window?

0, 0

0, getWidth()

getHeight(), getWidth()

getWidth(), getHeight()

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What are the coordinates of the center of the window?

getWidth(), getHeight()

getWidth() / 2, getHeight() / 2

getHeight() - getWidth(), getWidth() - getHeight()

getHeight() / 2, getWidth() / 2

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In the following code:

var size = 20;

var x = 100;

var y = 200;

var ball = new Circle(size);

ball.setPosition(x, y);

What is the meaning of the x variable?

The x coordinate of the center of the circle

The x coordinate of the left edge of the circle

The radius of the circle

The position of the circle

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

The following program should draw a circle on the screen

1 function start(){

2 var circle = new Circle(40);

3 circle.setPosition(getWidth() / 2, getHeight() / 2);

4 circle.setColor(Color.blue);

5 }

But when we run this code, we don’t see the circle. What is missing from our start function?

We never set the circle’s radius.We need to add the linecircle.setRadius(40);After line 4

We are setting the position of the ball to be off the canvas.

We need to change line 3 to be

circle.setPosition(0, 0);

We are creating the circle incorrectly. We need to specify the width and height.

We need to change line 2 to be

var circle = new Circle(40, 40);

We create the circle and position it correctly on the screen, but we never add it to the screen.

We need to add the line

add(circle);

after line 4

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is printed to the screen if the user enters ‘5’ when the following program is run?

var userNum = readInt("Enter your favorite number: ");

var calculatedNum = (userNum * userNum) + userNum;

println(calculatedNum);

5

25

30

50

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What is the output of the following program: (Assume the user enters ‘Florence’ then ‘Fernandez’.)

Fernandez Florence

Florence

Fernandez

FlorenceFernandez

Florence Fernandez

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What is printed to the screen when the following program is run?

1

2

3

4

Create a free account and access millions of resources

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

By signing up, you agree to our Terms of Service & Privacy Policy

Already have an account?