
Midterm Examination

Quiz
•
Computers
•
University
•
Hard
John Miranda
Used 5+ times
FREE Resource
50 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the syntax for a basic for loop in Java?
for (int i = 0; i < 10; i++)
for (i = 0; i < 10; i++)
for (i = 0; i <= 10; i++)
for (int i = 1; i <= 10; i++)
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the output of the following for loop?
for (int i = 0; i < 5; i++) {
System.out.print(i + " ");}
0 1 2 3 4 5
1 2 3 4 5 6
0 1 2 3 4 5 6
no output
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What happens if you omit the initialization expression in a for loop?
The loop will not execute.
The loop will execute indefinitely.
The loop will throw an error.
The loop will execute once.
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which of the following is true about the for-each loop in Java?
It can only be used with arrays.
It can only be used with collections.
It can be used with both arrays and collections.
It can be used with any type of data structure.
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the output of the following for loop?
for (int i = 10; i > 0; i -= 2) {
System.out.print(i + " ")}
2 4 6 8 20
10 8 6 4 2
9 7 5 3 1
1 3 5 7 9
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the purpose of the continue statement in a for loop?
It breaks out of the loop completely.
It skips the current iteration of the loop.
It goes to the next iteration of the loop.
It repeats the current iteration of the loop.
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the output of the following for loop?
for (int i = 0; i < 10; i++) {
if (i == 5) {
break;
}
System.out.print(i + " ");
}
0 1 2 3 4 5 6 7 8 9
0 1 2 3 4
5 6 7 8 9
Nothing is printed.
Create a free account and access millions of resources
Similar Resources on Wayground
45 questions
Java Programming Quiz

Quiz
•
University
50 questions
Midterm Examination-Advacomt (I-AINS) Asuncion

Quiz
•
University
45 questions
Technology

Quiz
•
University
51 questions
C Programming Quiz

Quiz
•
University
50 questions
OOP PRELIM

Quiz
•
University
55 questions
Final Examination: Fundamentals of Mixed Signals and Sensors

Quiz
•
University
50 questions
PF201: SCCPF2012223

Quiz
•
University
52 questions
ICT CBP Q3 Periodical Test

Quiz
•
9th Grade - University
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
Would you rather...

Quiz
•
KG - University
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)

Quiz
•
8th Grade - University
7 questions
Force and Motion

Interactive video
•
4th Grade - University
10 questions
The Constitution, the Articles, and Federalism Crash Course US History

Interactive video
•
11th Grade - University
7 questions
Figurative Language: Idioms, Similes, and Metaphors

Interactive video
•
4th Grade - University
20 questions
Levels of Measurements

Quiz
•
11th Grade - University
16 questions
Water Modeling Activity

Lesson
•
11th Grade - University
10 questions
ACT English prep

Quiz
•
9th Grade - University