Exam 6: Flow of Control, Part 2: Looping
Exam 1: Introduction to Programming and the Java Language47 Questions
Exam 2: Programming Building Blocks- Java Basics57 Questions
Exam 3: Object-Oriented Programming, Part 1: Using Classes62 Questions
Exam 4: Introduction to Graphical Applications57 Questions
Exam 5: Flow of Control, Part 1: Selection68 Questions
Exam 6: Flow of Control, Part 2: Looping67 Questions
Exam 7: Object-Oriented Programming, Part 2: User-Defined Classes78 Questions
Exam 8: Single-Dimensional Arrays63 Questions
Exam 9: Multidimensional Arrays and the Arraylist Class62 Questions
Exam 10: Object-Oriented Programming, Part 3: Inheritance, Polymorphism, and Interfaces61 Questions
Exam 11: Exceptions, and Input Output Operations77 Questions
Exam 12: Graphical User Interfaces Using Java FX89 Questions
Exam 13: Recursion59 Questions
Exam 14: An Introduction to Data Structures69 Questions
Exam 15: Running Time Analysis56 Questions
Exam 16: RGB Colors, Decimal Conversion, Java Naming, and Random Number Generation110 Questions
Select questions type
Which Java class enables us to read data easily from a file?
(Multiple Choice)
4.8/5
(41)
Evaluate this code segment, explaining any errors:
12 int count = 1;
13 int total = 1;
14 final int SENTINEL = -1;
15 int score;
(Essay)
4.8/5
(33)
Putting a semicolon after the loop condition of a while loop will most likely result in a(n) __________ or endless loop.
(Short Answer)
4.8/5
(36)
Curly braces around the loop body are optional if the loop body consists of only one statement.
(True/False)
4.7/5
(34)
How many times will a loop with the for loop header for ( i = 0; i < 6; i++ ) execute?
(Multiple Choice)
4.8/5
(41)
The body of a while loop is executed until the loop condition becomes __________.
(True/False)
4.9/5
(36)
When you use a while loop to compute the average of several values, what do you have to worry about when dividing the sum of these values by the number of these values?
(Essay)
4.7/5
(36)
How many times will a loop with the for loop header for ( i = 0; i <= 6; i++ ) execute?
(Multiple Choice)
4.9/5
(38)
What is the output of this code sequence?
for ( int i = 5; i >= 0; i-- )
System.out.print( i + " " );
System.out.println( );
(Short Answer)
5.0/5
(41)
The hasNext method in the Scanner class returns true if the input has another token, and false otherwise.
(True/False)
4.9/5
(35)
In the do/while loop, the loop condition is tested at the end of the loop, instead of at the beginning, as in the while loop.
(True/False)
4.8/5
(35)
How many times will a loop with the for loop header for ( i = 1; i <= 6; i++ ) execute?
(Multiple Choice)
4.8/5
(41)
When you use a while loop to compute the average of several values, what variables do you need to keep track of (in addition to holding the value being processed)?
(Multiple Choice)
4.8/5
(37)
The while loop is used to process each input value, one at a time, until a signal tells us that there is no more input. This is called:
(Multiple Choice)
4.9/5
(36)
What is the argument list for the nextFloat( ) method in the Scanner class?
(Multiple Choice)
4.8/5
(36)
When reading data from a file using a while loop, the typical condition to exit the loop is when you:
(Multiple Choice)
4.8/5
(42)
How many times will a loop with the for loop header for ( i = 5; i <= 15; i++ ) execute?
(Multiple Choice)
4.9/5
(34)
Showing 41 - 60 of 67
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)