
6.6.1 JavaScript Flashcard

Flashcard
•
Computers
•
8th Grade
•
Hard
Quizizz Content
FREE Resource
Student preview

14 questions
Show all answers
1.
FLASHCARD QUESTION
Front
Why do programmers use variables?
Back
To store values to easily reuse later and make code easier to read and understand
2.
FLASHCARD QUESTION
Front
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) var distance = 2; var time = 30;
Back
println (distance/(time/60))
3.
FLASHCARD QUESTION
Front
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);
Back
30
4.
FLASHCARD QUESTION
Front
A store has 20 apples in its inventory. How can you store this information in a JavaScript variable? Options: var numApples = 20;
Back
var numApples = 20;
5.
FLASHCARD QUESTION
Front
You want to read input from the user to know how many apples they would like to buy. Which statement should you use to read in a number from the user? Options: var applesToBuy = readLine("How many apples would you like? ");, var applesToBuy = println("How many apples would you like? ");, var applesToBuy = readInt("How many apples would you like? ");, var applesToBuy = nextInt("How many apples would you like? ");
Back
var applesToBuy = readInt("How many apples would you like? ");
6.
FLASHCARD QUESTION
Front
You are splitting up all of your apples equally between 3 people. Which statement below will calculate how many apples will be left over? Options: var leftover = numApples / 3; var leftover = numApples % 3; var leftover = 3 / numApples; var leftover = 3 % numApples;
Back
var leftover = numApples % 3;
7.
FLASHCARD QUESTION
Front
In order to write the function rollDice () for a game, I need to generate and store a random integer between 1 and 6. Which statement below will accomplish this task? Options: var diceRoll = Randomizer.nextInt (1,6);, var diceRoll = Randomizer.nextInt(0,7);, var diceRoll = Randomizer.nextNum (1,6);, var diceRoll = Randomizer (1,6);
Back
var diceRoll = Randomizer.nextInt (1,6);
Create a free account and access millions of resources
Similar Resources on Wayground
10 questions
Parallel - Linear Equations

Flashcard
•
9th Grade
9 questions
Python Basic Functions

Flashcard
•
6th - 8th Grade
11 questions
For Loops

Flashcard
•
9th Grade
10 questions
Java Basics Flashcard

Flashcard
•
9th Grade
10 questions
Python Variables

Flashcard
•
6th Grade
8 questions
Real Numbers

Flashcard
•
7th - 8th Grade
10 questions
S3 Exam Revision Page3

Flashcard
•
9th Grade
12 questions
The Real Number System

Flashcard
•
7th - 8th Grade
Popular Resources on Wayground
50 questions
Trivia 7/25

Quiz
•
12th Grade
11 questions
Standard Response Protocol

Quiz
•
6th - 8th Grade
11 questions
Negative Exponents

Quiz
•
7th - 8th Grade
12 questions
Exponent Expressions

Quiz
•
6th Grade
4 questions
Exit Ticket 7/29

Quiz
•
8th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade
20 questions
One Step Equations All Operations

Quiz
•
6th - 7th Grade
18 questions
"A Quilt of a Country"

Quiz
•
9th Grade