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
Match each term with the correct statement below.
Premises:
Multiply and assign
Responses:
binary operators
% =
loop control variable
Correct Answer:
Premises:
Responses:
(Matching)
4.7/5
(28)
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
(30)
A for loop provides a convenient way to create a(n) ____ loop.
(Multiple Choice)
4.8/5
(48)
public class IncrDemo
{
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)
4.9/5
(35)
What is loop fusion? Write a code segment that uses loop fusion to call two methods, method1 and method2 , 10 times each.
(Essay)
4.8/5
(36)
Match each term with the correct statement below.
Premises:
Remainder and assign
Responses:
loop fusion
for loop
decrementing
Correct Answer:
Premises:
Responses:
(Matching)
4.8/5
(29)
Match each term with the correct statement below.
Premises:
Subtracting 1 from a variable
Responses:
data validation
block
empty body
Correct Answer:
Premises:
Responses:
(Matching)
4.8/5
(33)
With ____ loops, the order of the conditional expressions can be important.
(Multiple Choice)
4.9/5
(49)
Many seasoned programmers start counter values at 1 because they are used to doing so when working with arrays.
(True/False)
4.8/5
(37)
Before entering a loop, the first input statement, or ____, is retrieved.
(Multiple Choice)
4.8/5
(38)
What kind of loop is this: response = keyboard.nextInt();
While (response == 1)
{
System.out.print ("Enter 1 to continue; 0 to stop");
response = keyboard.nextInt();
}
(Multiple Choice)
4.9/5
(31)
while(count < getNumberOfEmployees())
Examine the statement above. Write the code that will result in more efficient program execution assuming the result of getNumberOfEmployees() stays the same.
(Essay)
4.9/5
(34)
What would happen if a semicolon is mistakenly placed at the end of a partial statement of a while loop with a Boolean expression and with an empty body?
(Essay)
5.0/5
(34)
Showing 61 - 77 of 77
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)