Boolean Logic, Comparison Operators, and Loops Review Quiz
Quiz
•
Computers
•
10th Grade
•
Easy
Wayground Content
Used 2+ times
FREE Resource
20 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 2 pts
Complete the statement: The else block in an if-else statement is executed when ______.
A) All conditions are true
B) No conditions are true
C) The first condition is true
D) The last condition is true
Answer explanation
The else block in an if-else statement is executed when no conditions are true. This means that if all preceding if conditions fail, the else block will run, making option B the correct choice.
2.
MULTIPLE CHOICE QUESTION
30 sec • 2 pts
Anika is filling water bottles. She starts with 0 bottles and continues to fill one bottle at a time until she has filled 5 bottles. When does she stop filling bottles?
When she has filled 5 bottles
When she has filled 4 bottles
When she has filled 6 bottles
When she has filled 3 bottles
Answer explanation
Anika stops filling bottles when she has filled 5 bottles, as that is her goal. Therefore, the correct answer is when she has filled 5 bottles.
3.
MULTIPLE CHOICE QUESTION
30 sec • 2 pts
Michael and Harper are planning a picnic. They will go only if both the weather is sunny and they both have a day off. What does the && (AND) operator return when both conditions are true?
true
false
undefined
an error
Answer explanation
The && (AND) operator returns true when both conditions are true. Since Michael and Harper will picnic only if the weather is sunny and they both have a day off, both conditions being true results in true.
4.
MULTIPLE CHOICE QUESTION
30 sec • 2 pts
Zoe is deciding whether to go for a walk. She will only go if it is sunny and not raining. What is the result of it being sunny && raining?
She will go for a walk
She will not go for a walk
undefined
an error
Answer explanation
Zoe will not go for a walk because the condition requires it to be sunny and not raining. Since it is raining, the condition is not met.
5.
MULTIPLE CHOICE QUESTION
30 sec • 2 pts
What is the output of the following code? let i = 0;
while (i < 4) {
console.log(i);
i++;
}
A) 0 1 2 3
B) 1 2 3 4
C) 0 1 2 3 4
D) 2 3 4 5
Answer explanation
The code initializes i to 0 and enters a while loop that runs as long as i is less than 4. It logs the value of i and increments it. The output will be 0, 1, 2, and 3, making the correct answer A) 0 1 2 3.
6.
MULTIPLE CHOICE QUESTION
30 sec • 2 pts
Fill in the blank: Henry uses a for loop to ____ when he wants to practice his guitar scales a specific number of times each day.
Repeat a block of code a specific number of times
Execute code only once
Check conditions
Handle exceptions
Answer explanation
Henry uses a for loop to repeat a block of code a specific number of times, which is ideal for practicing guitar scales daily. The other options do not align with the purpose of a for loop.
7.
MULTIPLE CHOICE QUESTION
30 sec • 2 pts
What is the output of the following code? let i = 0;
while (i < 3) {
console.log(i);
i++;
}
A) 0 1 2
B) 1 2 3
C) 0 1 2 3
D) 2 3 4
Answer explanation
The code initializes i to 0 and enters a while loop that runs as long as i is less than 3. It logs the value of i and increments it. The output will be 0, 1, and 2, making the correct answer A) 0 1 2.
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
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?
Similar Resources on Wayground
19 questions
Bill Gates
Quiz
•
6th - 12th Grade
20 questions
Phishing quiz
Quiz
•
1st - 12th Grade
15 questions
DIT Excel 2016 Review
Quiz
•
8th - 12th Grade
22 questions
Steve Jobs
Quiz
•
6th - 12th Grade
22 questions
1.2.4 Data Storage - OCR
Quiz
•
9th - 10th Grade
15 questions
Unbound Report Quiz
Quiz
•
9th - 12th Grade
15 questions
Code.org Lesson 1-14
Quiz
•
9th - 12th Grade
20 questions
Google SketchUp Tool
Quiz
•
KG - University
Popular Resources on Wayground
20 questions
Halloween Trivia
Quiz
•
6th - 8th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
15 questions
Order of Operations
Quiz
•
5th Grade
20 questions
Halloween
Quiz
•
5th Grade
16 questions
Halloween
Quiz
•
3rd Grade
12 questions
It's The Great Pumpkin Charlie Brown
Quiz
•
1st - 5th Grade
20 questions
Possessive Nouns
Quiz
•
5th Grade
10 questions
Halloween Traditions and Origins
Interactive video
•
5th - 10th Grade
Discover more resources for Computers
10 questions
Halloween Traditions and Origins
Interactive video
•
5th - 10th Grade
20 questions
Halloween movies trivia
Quiz
•
7th - 12th Grade
15 questions
Halloween Characters
Quiz
•
7th - 12th Grade
10 questions
Halloween Movies Trivia
Quiz
•
5th Grade - University
10 questions
Halloween Trivia Challenge
Interactive video
•
6th - 10th Grade
10 questions
Understanding Meiosis
Interactive video
•
6th - 10th Grade
14 questions
Halloween Fun
Quiz
•
2nd - 12th Grade
28 questions
Ser vs estar
Quiz
•
9th - 12th Grade
