What number will be output by the console.log command on line 7?
Variables Warm up Code.org CSP Unit 4

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

8 questions
Show all answers
1.
FLASHCARD QUESTION
Front
Back
100
Answer explanation
The variable bop is initialized on line 2. On line 3, the variable bop is assigned the value 10. On line 5, the variable bop is assigned the value 100. Since the most recent value bop has been assigned is 100, that is the value that will be printed by the command on line 7.
2.
FLASHCARD QUESTION
Front
What text will be output by the program? Options: less than 10, less than 20, less than 30, 30 or more
Back
30 or more
Answer explanation
Walking through the program line by line:
On line 1, the variable score is initialized and assigned the value 0.
On line 2, the variable score is assigned its current value (0) plus 10. On line 3, the variable score is assigned its current value (10) plus 10. On line 4, the variable score is assigned its current value (20) plus 10.
On line 5, the boolean expression score < 10 evaluates to false since the current value of score is 30, which causes the command on line 6 to not execute.
On line 7, the boolean expression score < 20 evaluates to false since the current value of score is 30, which causes the command on line 8 to not execute.
On line 9, the boolean expression score < 30 evaluates to false since the current value of score is 30, which causes the command on line 10 to not execute.
Since all of the if-else-if statements have evaluated to false, the command inside the else statement will run and the console prints 30 or more.
3.
FLASHCARD QUESTION
Front
What will be the order of letters printed to the console when this program is run? Options: a b c, a b c b c b c, a b c b c, a b c a
Back
a b c b c
Answer explanation
Line 1 will print out a, line 2 calls the function letters which will print b then c. Line 3 calls the function letters agan which will print b then c.
4.
FLASHCARD QUESTION
Front
A movie theater charges different ticket prices based on a customer's age. The prices are shown in the table below. The customer's age is stored in the variable age and the price is stored in the variable price. Which piece of code will correctly decide the price for each ticket?
Back
Answer explanation
There are multiple ways to write this conditional statement so that it correctly decides the price for each ticket. C is the only one of these choices that accomplishes that. Options A and B will assign a ticket price of $8 to anyone over the age of 12, including those 65 and older. Option D will assign a ticket price of $8 to everyone under the age of 65, including those 12 and younger.
5.
FLASHCARD QUESTION
Front
What will the value of the variable bags be at the end of the flowchart shown here?
Back
2
Answer explanation
6.
FLASHCARD QUESTION
Front
What is the result of running this program and clicking on a buttonUp button 20 times?
00 var Count
01 Count = 0
02 onevent(buttonUp, Click), Count = Count + 1
Back
Count = 20
7.
FLASHCARD QUESTION
Front
Determine if the following statement evaluates to true or false.
(age > 10) && (age < 20)
Back
true
8.
FLASHCARD QUESTION
Front
Determine if the following statement evaluates to true or false.
(day == "Tuesday") || (age < 12)
Back
false
Similar Resources on Quizizz
8 questions
Variables Warm up Code.org CSP Unit 4

Flashcard
•
9th Grade
8 questions
AP CSP 12-2 U4L1 Variable

Flashcard
•
9th - 12th Grade
7 questions
CAASPP Practice Participation Math 8

Flashcard
•
8th Grade
3 questions
6.2 Jacksonian Democracy - American History

Flashcard
•
8th Grade
10 questions
TRẬT TÍNH TỪ

Flashcard
•
KG
9 questions
Atomic Structure

Flashcard
•
8th Grade
6 questions
Google Slides

Flashcard
•
7th - 8th Grade
8 questions
Variables Warm up Code.org CSP Unit 4

Flashcard
•
9th Grade
Popular Resources on Quizizz
15 questions
Character Analysis

Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
10 questions
American Flag

Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension

Quiz
•
5th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25

Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers

Quiz
•
6th - 8th Grade
Discover more resources for Computers
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
20 questions
Taxes

Quiz
•
9th - 12th Grade
17 questions
Parts of Speech

Quiz
•
7th - 12th Grade
20 questions
Chapter 3 - Making a Good Impression

Quiz
•
9th - 12th Grade
20 questions
Inequalities Graphing

Quiz
•
9th - 12th Grade
10 questions
Identifying equations

Quiz
•
KG - University