Control Structures in Java

Quiz
•
Computers
•
8th Grade
•
Hard
Adya Dalela
Used 86+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
How many choices are possible when using a single if-else statement?
1
2
3
4
2.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
How many "else" statements can you pair with a single "if" statement
1
<10
<20
As many as is needed.
3.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
How many "else if" links can you have in an "if else if" ladder?
<10
<20
<30
As many as is needed to represent the situation
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Give the O/P.
int age= 5;
if (age > 6)
System.out.println("John is getting ice cream");
else
System.out.println("John is getting apple juice");
System.out.println("John is getting grapes);
John is getting ice cream
John is getting grapes
John is getting apple juice
John is getting grapes
John is getting apple juice
John is getting ice cream
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
if (income > 3000) {
System.out.println("Income is greater than 3000");
}
else if (income > 4000) {
System.out.println("Income is greater than 4000");
}
No output
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
"Can get a driver's license" if age is greater than or equal to 16.
Which of the following code is the best?
System.out.println("Cannot get a driver's license");
if (age >= 16)
System.out.println("Can get a driver's license");
System.out.println("Cannot get a driver's license");
else
System.out.println("Can get a driver's license");
System.out.println("Cannot get a driver's license");
else if (age >= 16)
System.out.println("Can get a driver's license");
System.out.println("Cannot get a driver's license");
else if (age > 16)
System.out.println("Can get a driver's license");
else if (age == 16)
System.out.println("Can get a driver's license");
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
double temperature = 50;
if (temperature >= 100)
System.out.println("too hot");
else if (temperature <= 40)
System.out.println("too cold");
else
System.out.println("just right");
Create a free account and access millions of resources
Similar Resources on Wayground
12 questions
App Creator 1.4/1.5

Quiz
•
6th - 9th Grade
13 questions
Intro to IF statements

Quiz
•
KG - University
10 questions
Logic Building in Java Part 1

Quiz
•
6th - 9th Grade
6 questions
Java 4

Quiz
•
8th Grade
11 questions
Java Printing Quiz

Quiz
•
8th Grade
15 questions
JAVA: Level-1

Quiz
•
5th - 12th Grade
15 questions
Creative Commons

Quiz
•
8th Grade
10 questions
Database

Quiz
•
8th - 12th Grade
Popular Resources on Wayground
15 questions
Hersheys' Travels Quiz (AM)

Quiz
•
6th - 8th Grade
20 questions
PBIS-HGMS

Quiz
•
6th - 8th Grade
30 questions
Lufkin Road Middle School Student Handbook & Policies Assessment

Quiz
•
7th Grade
20 questions
Multiplication Facts

Quiz
•
3rd Grade
17 questions
MIXED Factoring Review

Quiz
•
KG - University
10 questions
Laws of Exponents

Quiz
•
9th Grade
10 questions
Characterization

Quiz
•
3rd - 7th Grade
10 questions
Multiply Fractions

Quiz
•
6th Grade