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
Using the for loop header for( int i = 0; i < 5; i++ ), the variable i will still be in scope after we exit the for loop.
(True/False)
4.7/5
(38)
Describe the conditions under which you would want to use a sentinel value.
(Essay)
4.8/5
(40)
A logic error is likely to happen if we set the sentinel value -1 in an addition calculator.
(True/False)
4.8/5
(43)
A special value that the user enters to signal the end of the input is called a(n) __________ value.
(Multiple Choice)
4.8/5
(38)
When a loop condition is grade >= 90, what values would you use to test your loop?
(Multiple Choice)
4.9/5
(32)
A loop condition may be simplified by applying __________ laws.
(Short Answer)
4.7/5
(36)
When you use a while loop to compute the sum of several values, you should initialize the variables holding the sum to:
(Multiple Choice)
4.8/5
(31)
You have a for loop nested in a while loop in order to find prime numbers. The proper way is to set the flag to false before starting the for loop that checks for factors. Inside the for loop, set the flag to true when a factor is found. After the for loop terminates, check the value of the flag. If it is still false, no factors were found and the number is prime.
(True/False)
4.9/5
(38)
When you use a sentinel value for the condition of a loop that processes user inputs, what case should you not forget to test?
(Multiple Choice)
4.9/5
(40)
When reading data from a user, the first time we read is called the __________.
(Short Answer)
4.9/5
(40)
In a for loop, a loop control variable is usually, but not always, for counting.
(True/False)
4.9/5
(37)
How many times will a loop with the for loop header for ( i = 5; i < 15; i++ ) execute?
(Multiple Choice)
4.9/5
(35)
Which of the following questions should you ask to verify a clean program?
(Multiple Choice)
4.8/5
(38)
The loop condition can be a complex condition involving several logical, equality, and relational operators.
(True/False)
4.9/5
(39)
To get a floating-point average, type cast one of the variables (either total or count) to a double or a float to force the division to be performed as floating-point. double average = (double) ( total ) / count;
(True/False)
4.9/5
(34)
You should always put a semicolon after the closing parenthesis in a for loop header.
(True/False)
4.7/5
(47)
When we use a while loop, we always know in advance how many times the loop body will be executed.
(True/False)
4.8/5
(33)
Using an if statement to validate input will find all errors without reprompting.
(True/False)
4.7/5
(37)
Showing 21 - 40 of 67
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)