
JavaScript Programming Quiz

Quiz
•
Computers
•
9th - 12th Grade
•
Medium
Corey Moore
Used 3+ times
FREE Resource
16 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
The following program should draw a circle on the screen.
But when we run this code, we don’t see the circle. What is missing from our start function?
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 are setting the position of the ball to be off the canvas.
We never set the circle’s radius. We need to add the line circle.setRadius(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
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following program: (Assume the user enters ‘Florence’ then ‘Fernandez’.)
Fernandez Florence
Florence
Fernandez
FlorenceFernandez
Florence Fernandez
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following choices is a properly formed JavaScript variable name, meaning it is both legal in the JavaScript language and considered good style?
user_age
UserAge
userAge
User age
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
If you wanted to use the following code to draw a circle to the canvas with the radius, and x and y coordinates given by the user, how would you ask for this information?
var x = readLine(“What is the x coordinate? “); var y = readLine(“What is the y coordinate? “); var radius = readLine(“What is the radius of the circle? “);
var x = readInt(“What is the x coordinate? “); var y = readInt(“What is the y coordinate? “); var radius = readInt(“What is the radius of the circle? “);
var x = readLine(“What is the x coordinate? “); var y = readLine(“What is the y coordinate? “); var radius = readInt(“What is the radius of the circle? “);
var x = readInt(“What is the x coordinate? “); var y = readInt(“What is the y coordinate? “); var radius = readLine(“What is the radius of the circle? “);
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
If you were given the following variables:
var distance = 2;
var time = 30;
What line of code would print the speed in km/hr if the distance is given in km and the time is given in minutes? (Speed = distance/time)
println(distance/(time/60));
println(distance/time);
println(distance*(time*60));
println(distance*time);
6.
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
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
A store has 20 apples in its inventory. How can you store this information in a JavaScript variable?
var numApples == 20;
20 = numApples;
var numApples = 20;
var num apples = 20;
Create a free account and access millions of resources
Similar Resources on Wayground
15 questions
JS and Graphics Unit Review

Quiz
•
9th - 12th Grade
15 questions
Mảng 1 chiều

Quiz
•
8th - 11th Grade
20 questions
PM_Pertemuan 3

Quiz
•
12th Grade
20 questions
Ինֆորմատիկա 11 բն.

Quiz
•
11th Grade
20 questions
Python Basic 1

Quiz
•
12th Grade
16 questions
Python Unit 3 Codehs

Quiz
•
9th - 12th Grade
16 questions
Python basics

Quiz
•
9th - 12th Grade
15 questions
JavaScript and Graphics

Quiz
•
9th - 12th Grade
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
10 questions
Proper Keyboarding Techniques

Interactive video
•
6th - 10th Grade
14 questions
Inputs and Outputs: Computer Science Intro

Lesson
•
5th - 9th Grade
10 questions
Understanding Computers: Hardware, Software, and Operating Systems

Interactive video
•
7th - 12th Grade
29 questions
AP CSP Unit 2 Review (Code.org)

Quiz
•
10th - 12th Grade