Question
In Java Answering: multiple choose: 1. In the following code, what values could be read into number to terminate the while loop? Group of answer
In Java Answering: multiple choose:
1. In the following code, what values could be read into number to terminate the while loop?
Group of answer choices
Numbers less than 100
Numbers greater than 500
Numbers in the range 100 - 499
Numbers in the range 100 - 500
2.
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?
Group of answer choices
int number = inputFile.nextInt();
int number = inputFile.next();
int number = inputFile.readInt();
int number = inputFile.integer();
3.
In all but rare cases, loops must contain within themselves:
Group of answer choices
arithmetic statements
if statements
a way to terminate
nested loops
In all but rare cases, loops must contain within themselves:
Group of answer choices
arithmetic statements
if statements
a way to terminate
nested loops
4.
Which of the following will open a file named MyFile.txt and allow you to read data from it?
Group of answer choices
File file = new File("MyFile.txt");
Scanner inputFile = new Scanner("MyFile.txt");
File file = new File("MyFile.txt"); Scanner inputFile = new Scanner(file);
PrintWriter inputFile = new PrintWriter("MyFile.txt");
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started