1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Ainat [17]
3 years ago
9

Assume inputFile is a Scanner object used to read data from a text file that contains a number of lines. Each line contains an a

rbitrary number of words, with at least one word per line. Select an expression to complete the following code segment, which prints the last word in each line. while (inputFile.hasNextLine()) { String word = ""; String line = inputFile.nextLine(); Scanner words = new Scanner(line); while (_________________) { word = words.next(); } System.out.println(word); }
Computers and Technology
1 answer:
anzhelika [568]3 years ago
7 0

Answer:

words.hasNext()

Explanation:

Given the code snippet below:

  1.        while (inputFile.hasNextLine()) {
  2.            String word = "";
  3.            String line = inputFile.nextLine();
  4.            Scanner words = new Scanner(line);
  5.            while (words.hasNext()) {
  6.                word = words.next();
  7.            }
  8.            System.out.println(word); }
  9.    }

We have a inputFile Scanner object that can read data from a text file and we presume the inputFile has read several rows of data from the text file. So long as there is another line of input data available, the outer while loop will keep running. In each outer loop, one line of data will be read and assign to line variable (Line 3). Next, there is another Scanner object, words, which will take the current line of data as input. To get the last word of that line, we can use hasNext() method. This method will always return true if there is another tokens in its input. So the inner while loop will keep running so long as there is a token in current line of data and assign the current token to word variable. The word will hold the last token of current line of data upon exit from the inner loop. Then we can print the output (Line 8) which is the last word of the current line of data.

You might be interested in
___________ is a task pane used to correct grammar errors; opens when you click the Spelling & Grammar button in the Proofin
BaLLatris [955]

Answer:

Spelling Task Pane

Explanation:

According to my research on Microsoft Office Studio, I can say that based on the information provided within the question the feature being mentioned in the question is called the Spelling Task Pane. By selecting this pane word will offer various grammar and spelling assistance, such as correcting words and offering one or more suggestions.

I hope this answered your question. If you have any more questions feel free to ask away at Brainly.

7 0
3 years ago
Read 2 more answers
What is an example of the most important role of a systems analyst in any corporation?
dsp73

Answer: The system analyst is one of the most important members in any organisation. These system analyst has to analyse different data of the organisation which would help to bring out the different any new business policy changes or any kind of improvement.

Explanation:

An example to know this better would be the system analyst of a telecom company. Here the role of the system analyst would be bring out the design and implementation of new telecom information system and also should be aware of previous data of the organization. The system analyst would also be responsible to bring out the new business policies based on latest telecom standards and ensure the systems conforms to the latest standards.

5 0
3 years ago
Choose the statements that CORRECTLY describe a business organization.​
Kryger [21]

Answer:

An advantage to Corporations aI's a business organization is that they enjoy unlimited life and limited liability.

Explanation:

Unlimited life and limited liability are the major advantages of corporations.

Corporations have unlimited life unless all the shareholders decides to dissolve the corporation.

It has limited liability, it means that only the company assets will be sold in case of debt and investors are not liable to pay the debt.

3 0
3 years ago
In textual​ messages, __________ includes the area surrounding​ headings, margins, paragraph​ indents, space around​ images, ver
rosijanka [135]

Answer:

The answer is "White space".

Explanation:

The textual​ messaging is a method for name, that consists of choosing verses, a chapter, or even the part of a chapter as a text. This method includes whitespace.

  • It is the area between the items on a website page. Generally, those items are pictures, typeface, and symbols.  
  • It is often used to align elements on a website by providing a smooth flow via the material for all the readers to move across.
3 0
3 years ago
Read 2 more answers
Pick one<br>a. wonder Woman <br>b. super woman​
Kazeer [188]

Answer:

Super Woman is the best

Explanation:

6 0
3 years ago
Read 2 more answers
Other questions:
  • Write a function M-file that takes as input two matrices A and B, and as output produces
    8·1 answer
  • What OS is most commonly used by businesses? Linux Macintosh Microsoft Windows
    11·1 answer
  • _________ is the process of scanning the network to find out which Internet Protocol (IP) addresses are attached to potentially
    9·1 answer
  • Can multiple processors can be installed in a single processor housing?
    14·2 answers
  • A palindrome is a word or phrase that reads the same both backward and forward. The word ""racecar"" is an example. Create an al
    15·1 answer
  • Write a statement that compares the values of score1 and score2 and takes the following actions. When score1 exceeds score2, the
    7·1 answer
  • 1. Define lexemes. Give an example of an lexeme in any programming language.<br>​
    10·1 answer
  • Why are default parameters useful? *This is JavaScript*
    7·1 answer
  • Calcula l'energia (Kwh) consumida per una màquina de 30 CV que funciona durant 2 hores.
    12·1 answer
  • Why are iterators useful?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!