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
8 online Safety Strands

Quiz
•
8th Grade
10 questions
Computer Software

Quiz
•
7th - 8th Grade
15 questions
Python

Quiz
•
6th Grade - University
8 questions
Flowcharts and algorithms

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

Quiz
•
KG - University
11 questions
Java Printing Quiz

Quiz
•
8th Grade
10 questions
Copyright and Legal Protection Quiz

Quiz
•
6th - 8th Grade
12 questions
Scratch -if else

Quiz
•
6th - 8th Grade
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
10 questions
UPDATED FOREST Kindness 9-22

Lesson
•
9th - 12th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
20 questions
US Constitution Quiz

Quiz
•
11th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
18 questions
Company Logos

Quiz
•
6th - 8th Grade
10 questions
Exploring Cybersecurity Techniques and Threats

Interactive video
•
6th - 10th Grade
10 questions
Understanding the Internet and Data Transmission

Interactive video
•
7th - 12th Grade
25 questions
How to Email a Teacher- https://youtu.be/NioeNhfpVfI

Quiz
•
6th - 8th Grade
20 questions
Computer Hardware

Quiz
•
6th - 8th Grade
21 questions
Gear Ratio Practice

Quiz
•
6th - 8th Grade