Why do programmers use variables?

6.1.1 JavaScript Flashcard

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

14 questions
Show all answers
1.
FLASHCARD QUESTION
Front
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) Options: println(distance/(time/60));, println(distance/time);, println(distance*(time*60));, println(distance*time);
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; 20 = numApples; var numApples = 20; var num apples = 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 Quizizz
10 questions
Массивы в Паскале

Flashcard
•
8th Grade
10 questions
Java Basics Flashcard

Flashcard
•
9th Grade
7 questions
Grade IX A B C

Flashcard
•
9th Grade
16 questions
Java Basics (Data Types and Variables)

Flashcard
•
6th - 10th Grade
10 questions
Python Variables

Flashcard
•
6th Grade
14 questions
Algorithms Review

Flashcard
•
9th Grade
14 questions
CodeHS: Unit6 - JavaScript Basics

Flashcard
•
9th Grade
12 questions
Basics Python

Flashcard
•
8th - 10th Grade
Popular Resources on Quizizz
15 questions
Multiplication Facts

Quiz
•
4th Grade
20 questions
Math Review - Grade 6

Quiz
•
6th Grade
20 questions
math review

Quiz
•
4th Grade
5 questions
capitalization in sentences

Quiz
•
5th - 8th Grade
10 questions
Juneteenth History and Significance

Interactive video
•
5th - 8th Grade
15 questions
Adding and Subtracting Fractions

Quiz
•
5th Grade
10 questions
R2H Day One Internship Expectation Review Guidelines

Quiz
•
Professional Development
12 questions
Dividing Fractions

Quiz
•
6th Grade
Discover more resources for Computers
5 questions
capitalization in sentences

Quiz
•
5th - 8th Grade
10 questions
Juneteenth History and Significance

Interactive video
•
5th - 8th Grade
10 questions
Identify Slope and y-intercept (from equation)

Quiz
•
8th - 9th Grade
10 questions
Juneteenth: History and Significance

Interactive video
•
7th - 12th Grade
15 questions
Volume Prisms, Cylinders, Cones & Spheres

Quiz
•
8th Grade
26 questions
June 19th

Quiz
•
4th - 9th Grade
25 questions
Argumentative Writing & Informational Text Vocabulary Review

Quiz
•
8th Grade
18 questions
Informational Text Vocabulary

Quiz
•
7th - 8th Grade