
Understanding If-Else Statements

Interactive Video
•
Computers
•
5th - 8th Grade
•
Hard

Amelia Wright
FREE Resource
Read more
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the purpose of an if-else statement?
To declare a variable.
To define a function.
To execute a block of code based on a condition.
To execute a block of code repeatedly.
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What keyword is used to start an if-else statement?
for
switch
while
if
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does the 'else' part of an if-else statement specify?
Code to execute if the condition is false.
Code to execute if the condition is true.
Code to execute before the condition is checked.
Code to execute after the condition is checked.
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is a correct way to start an if-else statement?
if (condition) { ... } else if (condition) { ... }
if condition { ... } else { ... }
if (condition) { ... } else { ... }
if (condition) { ... } else if { ... }
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which logical operator is used to check if a condition is not true?
&&
==
||
!
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does the 'not' operator do when the operand is true?
Returns true
Returns false
Returns the operand
Throws an error
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you write the 'not' operator in code?
^
!
|
&
Create a free account and access millions of resources
Similar Resources on Wayground
11 questions
Understanding and Managing Bugs in Coding

Interactive video
•
3rd - 7th Grade
11 questions
Identifying Errors in Algorithms

Interactive video
•
7th - 10th Grade
11 questions
Conditional Statements in Programming

Interactive video
•
7th - 10th Grade
8 questions
NASA and Google Engineers on Coding

Interactive video
•
5th - 8th Grade
6 questions
Minecraft Modding Quiz

Interactive video
•
6th - 8th Grade
11 questions
Programming Constructs and Control Flow

Interactive video
•
6th - 10th Grade
11 questions
Switch Case and Arduino Basics

Interactive video
•
6th - 7th Grade
11 questions
Bus Fare Discounts and Errors

Interactive video
•
6th - 10th Grade
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

Interactive video
•
10th - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
Discover more resources for Computers
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
8 questions
Time Management

Quiz
•
6th Grade
15 questions
Acceptable Use Policy (Quiz)

Quiz
•
6th - 8th Grade
25 questions
Career Vs. Job

Quiz
•
6th - 8th Grade
12 questions
3-5 Digital Citizenship: Appropriate Use

Quiz
•
3rd - 5th Grade
20 questions
Digital Citizenship

Quiz
•
8th - 12th Grade
30 questions
Introduction to Computers

Quiz
•
8th - 9th Grade
20 questions
Copyright and Fair Use

Quiz
•
6th - 8th Grade