Java Programming

Quiz
•
Computers
•
University
•
Hard
John Oli
Used 197+ times
FREE Resource
11 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 5 pts
Which example shows the correct syntax for a while loop?
Answer explanation
This is the correct example. It is important to have a trigger to exit out of a loop.
2.
MULTIPLE CHOICE QUESTION
30 sec • 5 pts
In the following code, which line numbers are in scope for the favoriteNumber variable?
3, 4
1, 2
1, 2, 3
1, 2, 3, 4
Answer explanation
Since the variable is declared inside the `if` statement, it is only available in lines 1 and 2 before the closing curly bracket is seen.
3.
MULTIPLE CHOICE QUESTION
30 sec • 5 pts
If the value of inputtedNum is 6, then what is the output of the following code?
<no output>
The sun will shine bright
The moon will glow bright
Error
Answer explanation
The value `6` would make the `if` condition false, so the code under the `else` statement would be executed.
4.
MULTIPLE CHOICE QUESTION
30 sec • 5 pts
Which control flow statement is represented by a diamond shape in a flowchart diagram?
while
if
do while
None
Answer explanation
A diamond shape is represented by the `if` statement in Java.
5.
MULTIPLE CHOICE QUESTION
30 sec • 5 pts
How would you best describe what control flow statements do in a program?
They can cause a block of code to be executed after a program terminates abnormally.
They can cause a block of code to be executed once, multiple times, or not at all.
They can cause a block of code to be executed line by line in sequential order.
They may cause Errors
Answer explanation
Control flow statements allow code to be executed in different ways besides the default sequential order.
6.
MULTIPLE CHOICE QUESTION
30 sec • 5 pts
How would you describe a while loop?
Check the condition; if it is true, then run a code block. Otherwise, run a different code block.
Check whether the condition is true; if it is true, then keep repeating until the condition is false.
Run a block of code and then check the condition; if the condition is true, then repeat the block of code.
Answer explanation
A `while` loop keeps repeating a block of code as long as the condition evaluates to a true value.
7.
MULTIPLE CHOICE QUESTION
30 sec • 5 pts
Given a symbol in each question, choose the best answer.
Represents a decision-making point
Represents arithmetic operations and data manipulations
Represents the start and the end of a flowchart
Represents the flow of the algorithm
Input-Output
Answer explanation
That is Correct
It Represents a decision-making point- Usually has flow lines coming out after it, representing the decision paths for each alternative (e.g., YES, NO)
Create a free account and access millions of resources
Similar Resources on Wayground
10 questions
ALMCTPS

Quiz
•
University
10 questions
Computer Quiz

Quiz
•
8th Grade - University
10 questions
7.10 Writing and Amending Algorithms Cambridge IGCSE 0478

Quiz
•
10th Grade - University
12 questions
Intro to Databases

Quiz
•
12th Grade - University
11 questions
C/C++ Programming Chapter 3

Quiz
•
University
10 questions
Algorithm, Pseudocode and Flowchart

Quiz
•
University
15 questions
Algoritma dan Flowchart Quiz

Quiz
•
11th Grade - University
10 questions
7.3 Designing and Constructing a Solution Cambridge IGCSE 0478

Quiz
•
10th 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