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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!