Exam 4: Loops and Files
Exam 1: Introduction to Computers and Java53 Questions
Exam 2: Java Fundamentals52 Questions
Exam 3: Decision Structures58 Questions
Exam 4: Loops and Files56 Questions
Exam 5: Methods56 Questions
Exam 6: A First Look at Classes58 Questions
Exam 7: Arrays and the Arraylist Class63 Questions
Exam 8: A Second Look at Classes and Objects52 Questions
Exam 9: Text Processing and More About Wrapper Classes62 Questions
Exam 10: Inheritance64 Questions
Exam 11: Exceptions and Advanced File Io59 Questions
Exam 12: Java-Fx: Gui Programming and Basic Controls42 Questions
Exam 13: Java-Fx: Advanced Controls40 Questions
Exam 14: Java-Fx: Graphics, Effects, and Media40 Questions
Exam 15: Recursion23 Questions
Exam 16: Databases40 Questions
Select questions type
Which of the following statements opens a file named MyFile.txt and allows you to read data from it?
(Multiple Choice)
4.8/5
(37)
The __________ loop is ideal in situations where you always want the loop to iterate at least once.
(Multiple Choice)
4.9/5
(34)
The do-while loop is ideal in situations where you always want the loop to iterate at least once.
(True/False)
4.9/5
(41)
Select all that apply. Which of the following steps is normally performed by a for loop?
(Multiple Choice)
4.7/5
(32)
What will be printed after the following code is executed? for (int number = 5; number <= 15; number +=3)
System.out.print(number + ", ");
(Multiple Choice)
4.8/5
(32)
Assuming that inputFile references a Scanner object that was used to open a file, which of the following statements will read an int from the file?
(Multiple Choice)
4.8/5
(37)
When the break statement is encountered in a loop, all the statements in the body of the loop that appear after it are ignored, and the loop prepares for the next iteration.
(True/False)
4.8/5
(36)
If a loop does not contain, within itself, a valid way to terminate, it is called a(n) __________ loop
(Multiple Choice)
4.9/5
(46)
Which of the following expressions will generate a random number in the range of 1 through 10?
(Multiple Choice)
4.9/5
(40)
A __________ is a value that signals when the end of a list of values has been reached.
(Multiple Choice)
4.7/5
(33)
What will be the value of x after the following code is executed?
int x = 10;
While (x < 100)
{
X += 100;
}
(Multiple Choice)
5.0/5
(37)
Java provides a set of simple unary operators designed just for incrementing and decrementing variables.
(True/False)
4.8/5
(38)
How many times will the following for loop be executed?
for (int count = 10; count <= 21; count++)
System.out.println("Java is great!");
(Multiple Choice)
4.8/5
(37)
What will be the value of x after the following code is executed?
int x, y = 4, z = 6;
X = (y++) * (++z);
(Multiple Choice)
4.9/5
(31)
What will be the values of x and y after the following code is executed? int x, y = 15, z = 3;
X = (y--) / (++z);
(Multiple Choice)
4.7/5
(31)
A(n) __________ is a special value that cannot be mistaken as a member of a list of data items and signals that there are no more data items to be processed.
(Multiple Choice)
5.0/5
(38)
Showing 21 - 40 of 56
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)