IF & CASE Conditional Statements

Quiz
•
Computers
•
9th - 12th Grade
•
Hard
Nazia Butt 24445/TCHR/BKMB
Used 2+ times
FREE Resource
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the syntax of an IF statement in computer science?
if (condition) { // code block to execute if condition is true }
if (condition) { // code block to execute if condition is false }
if (condition) then { // code block to execute if condition is true }
if [condition] then { // code block to execute if condition is true }
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How is a CASE statement structured in computer science?
CASE expression WHEN condition1 THEN action1 WHEN condition2 THEN action2 ELSE default_action END CASE
CASE expression WHEN condition1 THEN action1 WHEN condition2 THEN action2 ELSE default_action
CASE expression WHEN condition1 THEN action1 ELSE default_action END CASE
CASE condition1 THEN action1 WHEN condition2 THEN action2 ELSE default_action END CASE
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What are nested IF statements in computer science?
Nested IF statements are a way to include an IF statement inside another IF statement.
Nested IF statements are a way to combine multiple ELSE statements in computer science.
Nested IF statements are used for loop iterations in computer science.
Nested IF statements are only used in object-oriented programming.
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Explain the concept of IF-ELSE statements.
IF-ELSE statements can only have one condition.
IF-ELSE statements are only applicable in web development.
IF-ELSE statements are used for mathematical calculations only.
IF-ELSE statements provide a way to create branching logic in programs by evaluating conditions and executing different code paths accordingly.
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the purpose of IF...THEN...ELSE...ENDIF statements?
To skip code execution
To conditionally execute code based on a specified condition.
To repeat code multiple times
To define variables
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
When should you use an IF statement in programming?
When you want to execute a block of code regardless of any condition.
When you want to execute a block of code randomly.
When you want to execute a block of code only if a certain condition is true.
When you want to execute a block of code only if a certain condition is false.
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Can a CASE statement be used instead of multiple IF statements?
Yes
Sometimes
No
Rarely
Create a free account and access millions of resources
Similar Resources on Wayground
20 questions
AP CS A Unit 3 Review

Quiz
•
11th - 12th Grade
11 questions
49. Programming 1 : Basic Programming Constructs

Quiz
•
9th - 12th Grade
16 questions
Computer Science 2.2

Quiz
•
10th Grade
15 questions
Quiz - 9 on if-else

Quiz
•
12th Grade
16 questions
Python programming

Quiz
•
6th - 12th Grade
20 questions
Code.org Discoveries Conditional Blocks

Quiz
•
6th - 9th Grade
16 questions
Introduction to Programming Vocabulary

Quiz
•
9th - 12th Grade
20 questions
Java Summative Assessment 2

Quiz
•
12th 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
10 questions
1.2 OSI & TCP IP Models Quiz

Quiz
•
10th Grade
20 questions
Digital Citizenship

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

Quiz
•
8th - 9th Grade
35 questions
Computer Baseline Examination 2025-26

Quiz
•
9th - 12th Grade
13 questions
Problem Solving Process

Quiz
•
9th - 12th Grade
20 questions
Hardware vs. Software Quiz

Quiz
•
7th - 10th Grade
10 questions
Understanding Algorithms with Pseudocode and Flowcharts

Interactive video
•
9th - 12th Grade