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
10 questions
Java Math

Quiz
•
1st - 12th Grade
11 questions
Java Printing Quiz

Quiz
•
8th Grade
10 questions
Homework 5- Variables and selection

Quiz
•
8th Grade
15 questions
ICT Application - School Management System

Quiz
•
8th - 11th Grade
10 questions
Computer Software

Quiz
•
7th - 8th Grade
13 questions
VEX Robotics Safety Test

Quiz
•
7th - 8th Grade
13 questions
Intro to IF statements

Quiz
•
KG - University
9 questions
recupero informatica 3a liceo ballerini

Quiz
•
8th Grade
Popular Resources on Wayground
50 questions
Trivia 7/25

Quiz
•
12th Grade
11 questions
Standard Response Protocol

Quiz
•
6th - 8th Grade
11 questions
Negative Exponents

Quiz
•
7th - 8th Grade
12 questions
Exponent Expressions

Quiz
•
6th Grade
4 questions
Exit Ticket 7/29

Quiz
•
8th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade
20 questions
One Step Equations All Operations

Quiz
•
6th - 7th Grade
18 questions
"A Quilt of a Country"

Quiz
•
9th Grade