
Java - If Else Switch
Authored by taha Rupawala
Computers
9th - 12th Grade
Used 15+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
6 questions
Show all answers
1.
MULTIPLE SELECT QUESTION
30 sec • 1 pt
What are the conditional statements in Java
else if
switch
if switch
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
PREDICT THE OUTPUT:
int x = 20;
int y = 18;
if(x>y)
{
System.out.println("x is greater than y");
}
else
{
System.out.println("Error");
System.out.println("Incorrect code");
}
Error
Incorrect code
x is greater than y
Error
Incorrect Code
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
PREDICT THE OUTPUT:
int time = 16;
if(time > 12)
{
System.out.println("Good Afternoon");
}
else
{
System.out.println("Good night");
}
Good Night
Good night
Good Afternoon
Good afternoon
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
PREDICT THE OUTPUT:
int x = 60;
int y = 90;
if (y%x == 0 && y-x==30)
{
System.out.println("Hello World");
}
else
{
System.out.println("Error")
}
Hello World
Error
Hello world
Hello World
Error
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
FILL IN THE BLANKS:
int x = 50;
int y = 10;
__ ( x__y)
{
System.out.println("Hello World");
}
if, <
else, >
if, >
if, %
6.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
FILL IN THE BLANK:
int x = 50;
int y = 50;
__(x__y)
{
System.out.println("1");
}
__(x>y)
{
System.out.println("2");
}
__
{
System.out.println("3");
}
if, ==, else if, else
else, %, if else if, else
else if, if, else, if
if, --, else if, else
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
11 questions
Maintaining Hand Tools- CSS 9
Quiz
•
9th Grade
10 questions
Activity 1: How well do you know Java?
Quiz
•
9th Grade
11 questions
Basic Python Bug Squashing
Quiz
•
9th Grade
10 questions
What would you do if...
Quiz
•
1st - 12th Grade
10 questions
แบบทดสอบก่อนเรียนวิชาโปรแกรมฐานข้อมูล
Quiz
•
9th - 12th Grade
9 questions
Test Excel
Quiz
•
10th - 12th Grade
8 questions
Overview of IT
Quiz
•
6th Grade - University
10 questions
UNIT 2.4 LOGIC
Quiz
•
10th Grade
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