CS Ch5 T/F
In a for loop, the control variable is always incremented.
F
The for loop is a posttest loop that has built-in expressions for initializing, testing, and updating.
F
The while loop is always the best choice in situations where the exact number of iterations is known.
F
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.
F
A file must always be opened before using it and closed when the program is finished using it.
T
The do-while loop is ideal in situations where you always want the loop to iterate at least once.
T
When the continue 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.
T
When you open a file with the PrintWriter class, the class can potentially throw an IOException.
T
When you pass the name of a file to the PrintWriter constructor and the file already exists, it will be erased and a new empty file with the same name will be created.
T
You can use the PrintWriter class to open a file and write data to it.
T