Exam 6: Looping
Exam 1: Creating Your First Java Classes76 Questions
Exam 2: Using Data81 Questions
Exam 3: Using Methods, Classes and Objects79 Questions
Exam 4: More Object Concepts84 Questions
Exam 5: Making Decisions80 Questions
Exam 6: Looping77 Questions
Exam 7: Characters, Strings and the Stringbuilder82 Questions
Exam 8: Arrays77 Questions
Exam 9: Advanced Array Concepts80 Questions
Exam 10: Introduction to Inheritance78 Questions
Exam 11: Advanced Inheritance Concepts78 Questions
Exam 12: Exception Handling79 Questions
Exam 13: File Input and Output78 Questions
Exam 14: Introduction to Swing Components79 Questions
Exam 15: Using Javafx and Scene Builder65 Questions
Select questions type
What are some unconventional uses of the three sections inside the parentheses of a for loop? Show at least three examples using code.
(Essay)
4.8/5
(45)
Match each term with the correct statement below.
Premises:
Part of the Thread class in the java.lang package
Responses:
accumulating
block
do-nothing loop
Correct Answer:
Premises:
Responses:
(Matching)
4.8/5
(43)
A ____ is a structure that allows repeated execution of a block of statements.
(Multiple Choice)
4.9/5
(40)
Match each term with the correct statement below.
Premises:
A body with no statements
Responses:
% =
empty body
prefix ++
Correct Answer:
Premises:
Responses:
(Matching)
4.8/5
(38)
What is wrong with the following code? while (4>2)
System.out.println ("Hi there");
(Multiple Choice)
4.8/5
(34)
____ is a technique that can improve loop performance by combining two loops into one.
(Multiple Choice)
5.0/5
(37)
A(n) ____ loop is a special loop that is used when a definite number of loop iterations is required.
(Multiple Choice)
4.8/5
(41)
A(n) ____ loop is one that performs no actions other than looping.
(Multiple Choice)
4.9/5
(36)
Provide a code example of a pretest loop and an example of a posttest loop.
(Essay)
4.8/5
(33)
counterLoop = 1;
while(counterLoop < 10);
{
System.out.println("Hello");
counterLoop = counterLoop + 1;
}
What is the problem in the above while loop? How would you correct the problem?
(Essay)
4.8/5
(31)
Shortcut operators are a programmer's only choice when incrementing or accumulating a variable's value.
(True/False)
4.8/5
(31)
Programmers rarely use indefinite loops when validating input data.
(True/False)
4.8/5
(37)
You use a unary minus sign preceding a value to make the value ____.
(Multiple Choice)
4.9/5
(45)
Why would a loop with altered user input be considered a type of indefinite loop? Give an example.
(Essay)
4.8/5
(43)
The process of repeatedly increasing a value by some amount is known as ____.
(Multiple Choice)
4.9/5
(36)
What is the output of the following code: loopCount = 1;
While(loopCount < 3)
{
System.out.println("Hello");
loopCount = loopCount + 1;
}
(Multiple Choice)
4.7/5
(30)
Showing 21 - 40 of 77
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)