Exam 6: Looping
Exam 1: Creating Java Programs68 Questions
Exam 2: Using Data74 Questions
Exam 3: Using Methods, Classes, and Objects68 Questions
Exam 4: More Object Concepts67 Questions
Exam 5: Making Decisions70 Questions
Exam 6: Looping72 Questions
Exam 7: Characters, Strings, and the Stringbuilder73 Questions
Exam 8: Arrays74 Questions
Exam 9: Advanced Array Concepts74 Questions
Exam 10: Introduction to Inheritance70 Questions
Exam 11: Advanced Inheritance Concepts70 Questions
Exam 12: Exception Handling65 Questions
Exam 13: File Input and Output74 Questions
Exam 14: Introduction to Swing Components74 Questions
Exam 15: Advanced Gui Topics69 Questions
Exam 16: Graphics74 Questions
Exam 17: Applets, Images, and Sound72 Questions
Select questions type
Match each term with the correct statement below.
-Multiple statements within curly braces
(Multiple Choice)
4.9/5
(38)
Create an indefinite while loop that will validate that the loop control variable named userNum is less than the constant MAXVALUE. While true, create a println statement to output "Please enter a higher value". Once MAXVALUE is reached, create a final println statement that will output "Max value reached".
(Essay)
4.8/5
(35)
Making a comparison to 0 is slower than making a comparison to any other value.
(True/False)
4.8/5
(42)
How could you rewrite the following code to have the arithmetic performed only once, even if the loop executes 1,000 times?
while (x < a + b)
// loop body
(Essay)
4.8/5
(43)
Altering a variable within both a for statement and within the block it controls can produce errors that are difficult to find.
(True/False)
4.9/5
(32)
Programmers rarely use indefinite loops when validating input data.
(True/False)
4.8/5
(34)
Match each term with the correct statement below.
-The technique of combining two loops into one
(Multiple Choice)
4.9/5
(36)
If a(n) ____________________ is altered both within the for statement and within the block it controls, it can be very difficult to follow the program's logic.
(Short Answer)
4.7/5
(39)
As long as methods do not depend on one another, ____ is a technique that can improve loop performance by combining two loops into one.
(Multiple Choice)
4.8/5
(41)
Write a for loop that will initialize the variables value1 to 11 and value2 to 19. Create a test section of the for statement that will test if value1 is greater than 10 and value2 is less than 20. Finally, end the for statement by incrementing value1 by 1. In the loop body, write a println statement that will display the contents of value1.
(Essay)
4.9/5
(33)
Besides initializing, testing, and incrementing, you can also perform other tasks with a for loop. What are some of these tasks? Use code samples as examples.
(Essay)
4.7/5
(39)
Match each term with the correct statement below.
-Part of the Thread class in the java.lang package
(Multiple Choice)
5.0/5
(37)
Describe the purpose of a loop control variable. How are Boolean values and a while loop involved?
(Essay)
4.9/5
(41)
When nesting loops, the variable in the outer loop changes more frequently.
(True/False)
4.8/5
(39)
Match each term with the correct statement below.
-The value that determines whether loop execution continues
(Multiple Choice)
4.9/5
(32)
In order to improve loop performance, it's important to make sure the loop does not include unnecessary operations or statements.
(True/False)
4.8/5
(35)
Shortcut operators are a programmer's only choice when incrementing or accumulating a variable's value.
(True/False)
4.8/5
(27)
Showing 41 - 60 of 72
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)