
conditional statements and While Loop
Authored by Fatma Metwally
Information Technology (IT)
University
Used 5+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
11 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code if int x = 5?
Greater than 10
10 or less
No output
Error
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is wrong with the following code?
Missing a semicolon
The if condition is missing parentheses
== should be =
Nothing, the code is correct
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
You want to assign a discount based on a customer’s age:
Age 0-12: "Child discount"
Age 13-18: "Teen discount"
Age 19-64: "Adult discount"
Age 65 and above: "Senior discount"
Which type of control structure is best suited for this scenario?
if
if-else if
switch
while
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Given the following code, what would be the output if grade = 85;?
A
B
C
D
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code if int x = 5;?
Equal to 10
Not equal to 10
No output
Compilation error
Answer explanation
The condition mistakenly uses = for assignment instead of == for comparison, so x = 10 makes x equal to 10, which is non-zero (true), and the if block executes.
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will the following code print if int grade = 75;?
Excellent Done
Good Done
Good
Average Done
Answer explanation
grade is 75, so grade > 70 is true, which makes "Good" print. The final cout << " Done"; is outside the conditions, so "Done" is also printed.
7.
OPEN ENDED QUESTION
3 mins • 1 pt
Write a program that checks if a number is positive, negative, or zero. Display appropriate messages for each case.
Evaluate responses using AI:
OFF
Access all questions and much more by creating a free account
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
15 questions
Explorando o IoT
Quiz
•
University
12 questions
Recap W02 - W04 Information and Communication Technology
Quiz
•
University
10 questions
Quizzi bài 29 Tin học 10
Quiz
•
10th Grade - University
10 questions
Quiz Meet 3 Mini SC Programing
Quiz
•
University
10 questions
Quiz on Basics of C
Quiz
•
University
13 questions
Nano quiz: Bottleneck of Motivation 2 and Receptivity Threshold
Quiz
•
University
15 questions
Quiz sobre Sistemas de Informação
Quiz
•
University
15 questions
InfoSec Quiz 1
Quiz
•
University
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade
Discover more resources for Information Technology (IT)
12 questions
IREAD Week 4 - Review
Quiz
•
3rd Grade - University
23 questions
Subject Verb Agreement
Quiz
•
9th Grade - University
7 questions
Force and Motion
Interactive video
•
4th Grade - University
7 questions
Renewable and Nonrenewable Resources
Interactive video
•
4th Grade - University
5 questions
Poetry Interpretation
Interactive video
•
4th Grade - University
19 questions
Black History Month Trivia
Quiz
•
6th Grade - Professio...
15 questions
Review1
Quiz
•
University
15 questions
Pre1
Quiz
•
University