
Understanding Conditionals in Coding
Quiz
•
Computers
•
8th Grade
•
Practice Problem
•
Medium
Pablo Quintero
Used 6+ times
FREE Resource
Enhance your content in a minute
16 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
20 sec • 8 pts
What’s an example of an “If…then” statement?
If you finish your homework, then you can play outside.
I like playing games outside.
Because I finished my homework, I played outside.
Playing outside is fun.
Answer explanation
The correct choice, "If you finish your homework, then you can play outside," is a clear example of an "If…then" statement, indicating a condition and its consequence.
2.
MULTIPLE CHOICE QUESTION
20 sec • 8 pts
What’s an example of an “If…then…else” statement?
If it’s raining, then bring an umbrella, else wear sunglasses.
I will bring an umbrella because it’s raining.
If it’s raining, then bring an umbrella.
I love wearing sunglasses when it’s sunny.
Answer explanation
The correct choice, "If it’s raining, then bring an umbrella, else wear sunglasses," clearly follows the "If…then…else" structure, providing a condition and two possible actions based on that condition.
3.
MULTIPLE CHOICE QUESTION
20 sec • 8 pts
In coding, conditionals tell a computer to do which of the following?
How to do it
To do it faster
When to do it
Where to do it
Answer explanation
Conditionals in coding specify 'when' certain actions should occur based on specific criteria. They do not dictate 'how', 'faster', or 'where' to perform tasks, making 'when to do it' the correct choice.
4.
MULTIPLE CHOICE QUESTION
20 sec • 8 pts
True or false: A conditional statement must have all the following: If, then, else
False
True
Answer explanation
The statement is false because a conditional statement only requires 'if' and 'then'. The 'else' part is optional and not necessary for a conditional to exist.
5.
MULTIPLE CHOICE QUESTION
20 sec • 8 pts
Which of these is a true conditional statement?
If the light is red, then stop.
Stop when the light is red.
Because the light is red, stop.
I stopped at the red light.
Answer explanation
The correct choice, "If the light is red, then stop," is a true conditional statement as it clearly establishes a cause-and-effect relationship. The other options do not present a conditional structure.
6.
MULTIPLE CHOICE QUESTION
20 sec • 8 pts
What does an “else” statement do in a conditional?
It tells what to do if the “if” condition is met.
It tells what to do if the “if” condition is not met.
It repeats the “if” condition.
It restarts the program.
Answer explanation
An 'else' statement specifies the actions to take when the 'if' condition is not met, providing an alternative path in the code. This is why the correct answer is that it tells what to do if the 'if' condition is not met.
7.
MULTIPLE CHOICE QUESTION
20 sec • 8 pts
Which of the following would best describe a conditional?
A list of things to do.
A choice based on a condition.
A result after an action.
A way to repeat an action.
Answer explanation
A conditional refers to a choice made based on whether a specific condition is true or false. This distinguishes it from lists, results, or repetition, making 'A choice based on a condition' the best description.
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
18 questions
Publisher Basics
Quiz
•
7th - 10th Grade
20 questions
CS-9 Chapter-2 Types of Computer Part1: Rabin Ghimire
Quiz
•
8th - 9th Grade
14 questions
Adobe Premiere Pro :>>
Quiz
•
8th Grade
20 questions
икт 21-40
Quiz
•
1st Grade - University
11 questions
Python Variables
Quiz
•
6th - 8th Grade
17 questions
Grade 4 Computer Science Quiz
Quiz
•
4th Grade - University
16 questions
Hour_of_Code
Quiz
•
5th - 12th Grade
17 questions
Networks Lesson 2 - Recap and Review
Quiz
•
6th - 8th 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
