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.
-Subtracting 1 from a variable
(Multiple Choice)
4.9/5
(44)
The ____________________ loop is the posttest loop used in Java.
(Short Answer)
4.8/5
(37)
It is important that the loop control ____ be altered within the body of the loop.
(Multiple Choice)
5.0/5
(41)
counterLoop = 1;
while(counterLoop < 10);
{
System.out.println("Enter a new value");
counterLoop = counterLoop + 1;
}
What is the problem in the above while loop? How would you correct the problem?
(Essay)
4.7/5
(32)
A(n) ____ loop is a special loop that is used when a definite number of loop iterations is required.
(Multiple Choice)
4.9/5
(37)
How many times will outputLabel be called? for(customer = 1; customer <= 20; ++customer)
For(color = 1; color <= 3; ++color)
OutputLabel();
(Multiple Choice)
4.9/5
(42)
When you want to increase a variable's value by exactly 1, use the ____.
(Multiple Choice)
4.8/5
(37)
public class CaseDemo
{
public static void main(String[] args)
{
int myVal, yourVal;
myVal = 10;
System.out.println("My initial value is " + myVal);
yourVal = ++myVal;
System.out.println("My new value is " + myVal);
System.out.println("Your value is " + yourVal):
}
}
Using the above code, describe how the three println output commands will appear. Explain the values stored in the variables during code execution.
(Essay)
5.0/5
(38)
What are some of the shortcuts Java provides programmers for incrementing and accumulating? Give examples of statements.
(Essay)
4.7/5
(47)
The order of the conditional expressions in the following is most important within a(n) ____ loop. while(requestedNum > LIMIT || requestedNum < 0)…
(Multiple Choice)
4.8/5
(39)
A ____ is a structure that allows repeated execution of a block of statements.
(Multiple Choice)
4.8/5
(33)
The ____ loop checks the value of the loop control variable at the bottom of the loop after one repetition has occurred.
(Multiple Choice)
4.7/5
(39)
Match each term with the correct statement below.
-A shortcut for incrementing and accumulating
(Multiple Choice)
4.9/5
(37)
Which of the following is NOT a valid method to increase a variable named score by 1?
(Multiple Choice)
4.9/5
(41)
Loop control variables can be evaluated at the start or the end of the loop. Describe both pretest loops and posttest loops. How do do…while loops execute?
(Essay)
4.9/5
(28)
while(10 > 1)
{
System.out.println("Enter a new value");
}
Identify the problem that exists in the above code.
(Essay)
4.8/5
(37)
Showing 21 - 40 of 72
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)