
Conditional Quiz
Quiz
•
Computers
•
3rd - 12th Grade
•
Practice Problem
•
Easy
Donna Panter
Used 6+ times
FREE Resource
Enhance your content in a minute
21 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is output by the code below?
var dogs = 4;
if (dogs > 3) {
write("Boxer");
} else if (dogs <= 2) {
write("Golden Retriever");
}
Boxer
Golden Retriever
True
No output
Answer explanation
4 is greater than 3 so the first if statement evaluates true. Therefore the first write is what is outputted.
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output?
var cat = 3;
if (cat == 2) {
write("Good kitty");
} else if (cat == 3) {
write("Mean kitty");
} else if (cat == 1) {
write("Ugly kitty");
}
Good kitty
Mean kitty
Ugly kitty
true
Answer explanation
if (cat == 2) {
write("Good kitty");
} else if (cat == 3) {
write("Mean kitty");
} else if (cat == 1) {
write("Ugly kitty");
}
Since cat is assigned the value of 3, the else if statement of cat == 3 is true. So the write of Mean kitty is written.
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output?
var dog = 9;
if ( (dog > 2) && (dog < 13) ) {
write("I love dogs");
} else if ( dog < 5 ) {
write("I love cats");
}
I love dogs
I love cats
true
no output
Answer explanation
if ( (dog > 2) && (dog < 13) ) {
write("I love dogs");
} else if ( dog < 5 ) {
write("I love cats");
}
Since dog holds the value of 9, the first if statement evaluates to true. So the output is I love dogs. The else if statement will not be evaluated since the if statement is true.
4.
FILL IN THE BLANK QUESTION
1 min • 1 pt
What is output?
var song = 3;
if (song > 9) {
write ("My favorite song is ");
} else if (song > 3) {
write("I don't like the song ");
} else if (song < 4) {
write("Sing the song ");
}
write("Chicken Nugget Song");
_____________________
5.
FILL IN THE BLANK QUESTION
1 min • 1 pt
What is output ?
var school = 3;
if (school <= 2) {
write("Texans");
} else {
write("Astros");
}
_____________________
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is output?
var school = 3;
if ( school == 5 || 3) {
write("Phillies");
} else if (school > 4){
write("Cardinals");
}
Phillies
Cardinals
true
Phillies, but there is a syntax error
Answer explanation
syntax error because the or in the first if statement should have:
(school == 5) || (school == 3)
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is output?
var x = 32;
write( x >= 45 || x < 32 ) ;
true
false
32
45
Create a free account and access millions of resources
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
20 questions
PTS KELAS 8 SMT 2
Quiz
•
8th Grade
20 questions
Pemrograman Dasar
Quiz
•
10th Grade
20 questions
Computasional Thinking Test
Quiz
•
7th Grade
20 questions
COMPUTER TEST
Quiz
•
1st - 7th Grade
17 questions
Challenge Grade 4
Quiz
•
4th Grade
20 questions
Analisis Data X-2
Quiz
•
10th Grade
20 questions
PH Infromatika kls IX Bab 4, 5, 6
Quiz
•
9th Grade
20 questions
Computer Fundamentals
Quiz
•
10th Grade
Popular Resources on Wayground
5 questions
This is not a...winter edition (Drawing game)
Quiz
•
1st - 5th Grade
15 questions
4:3 Model Multiplication of Decimals by Whole Numbers
Quiz
•
5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
10 questions
The Best Christmas Pageant Ever Chapters 1 & 2
Quiz
•
4th Grade
12 questions
Unit 4 Review Day
Quiz
•
3rd Grade
10 questions
Identify Iconic Christmas Movie Scenes
Interactive video
•
6th - 10th Grade
20 questions
Christmas Trivia
Quiz
•
6th - 8th Grade
18 questions
Kids Christmas Trivia
Quiz
•
KG - 5th Grade
Discover more resources for Computers
40 questions
TSDE Semester Final Review
Quiz
•
8th Grade
18 questions
Company Logos
Quiz
•
6th - 8th Grade
15 questions
Internet Vocabulary Notebook Check #2 - CTEA(2024)
Quiz
•
12th Grade
13 questions
Computer/ Internet Company Trademark Logos
Quiz
•
7th Grade
11 questions
Internet Terms Vocabulary- Notebook Check #1- CTEA
Quiz
•
12th Grade
39 questions
UNIT 7 and UNIT 8 — Multiple Choice Question Bank (Extracted)
Quiz
•
9th Grade
50 questions
Money Matters Fall 2025 Final Exam — Worksheet Questions
Quiz
•
12th Grade
47 questions
CSF Final Exam Practice
Quiz
•
9th - 12th Grade
