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
Gnesinka [82]
3 years ago
5

Write a program that reads in text from standard input (hint: use Scanner) and prints out the number of words in the text. For t

he purpose of this exercise, a word is a sequence of non-whitespace characters that is surrounded by whitespace.
Computers and Technology
1 answer:
Vitek1552 [10]3 years ago
4 0

Answer:

The solution code is written in Java

  1.        Scanner input = new Scanner(System.in);
  2.        System.out.print("Enter a text: ");
  3.        String inputStr = input.nextLine();
  4.        String wordList[] = inputStr.split(" ");
  5.        System.out.println("The number of word in the input text: " + wordList.length);

Explanation:

Firstly, create a Scanner object to read the user input text using nextLine method (Line 1-3).

Next, we can use the string split method and use single space " " as the separator to convert the input text to an array of individual word (Line 5).

We can simply use println to display the number of words in the array by using the length property of the array (Line 7). The word count is equal to the array length.  

You might be interested in
Substance abuse is an _____ coping mechanism.
hichkok12 [17]
Mental coping mechanism.
7 0
3 years ago
((Excel)) please help, 100 points, and brain crown thingy, not only that, i will make several of these so you can get several hu
cupoosta [38]

Answer:

First you read the question and numbers, then you use the numbers in the correct way and you try reallllyyy hard, you will find your answer! Hope this helps! :D

4 0
3 years ago
How can security professionals use software to recover stolen laptops ?
inna [77]

<u>Answer is:</u>

E). They monitor email traffic.

<u>Explanation:</u>


Track Your Device's IP Address with mail. If your laptop or smartphone was stolen, you can use a service like mail to find the IP address of your thief. When you log into those services from any computer, it logs the IP address used, and displays your last used IP in your account. So, these are source for finding the stolen laptop and smartphones.

I hope you got the idea. Thanks

3 0
3 years ago
A(n) __________is an output device that enable a machine operator to view the acc or pre vlaue of an insstruction without the us
antoniya [11.8K]

A <u>LED display</u> is an output device that enable a machine operator to view the acc or pre vlaue of an insstruction without the use of a programming terminal

<h3>What is LED display device?</h3>

LED Display (light-emitting diode display) is a screen display technology that uses a panel of LEDs as the light source. Currently, a large number of electronic devices, both small and large, use LED display as a screen and as an interaction medium between the user and the system.

<h3>Where is LED display used?</h3>

An LED (Light-Emitting Diode) is a small cell or conductor that glows and becomes illuminated when a voltage is applied to it. The phrase 'LED display' is often used broadly to describe screens on a wide range of devices. This includes commercial and consumer technology such as TVs, mobile phones, and PC monitors.

To learn more about LED Display , refer

brainly.com/question/17019750

#SPJ4

8 0
1 year ago
Why are high-quality transformers wound with large diameter wire?      A. To lower the hysteresis losses B. To lower the magneti
Alja [10]
D.) So that they can lower the I2R losses
7 0
3 years ago
Other questions:
  • When computers connect to one another to share information, but are not dependent on each other to work, they are connected thro
    14·2 answers
  • What are the cause of eye strain during computer usage?
    7·1 answer
  • Which program can damage your computer
    13·2 answers
  • To resize columns in a subform, press and hold or right-click the subform in the navigation pane, and tap or click ____ on the s
    12·1 answer
  • January 16, 2018 Q1: This question is worth 99 points and a brainliest. It is a one part question. Medium difficulty.
    5·2 answers
  • What feature of a word processing program helps you to easily check and correct spelling mistakes?
    9·1 answer
  • You receive an email from someone who claims to be a representative from your credit card company. the email asks you to clink o
    12·1 answer
  • When you open a browser window, it open in a _____. <br> a. fieldb. folderc. menud. window?
    7·1 answer
  • Select the correct answer from each drop-down menu
    7·1 answer
  • Does anyone have discord
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!