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
Technician A says that a lead acid battery uses straight Hydrochloric acid for electrolyte. Technician B says that a lead acid b
konstantin123 [22]

Technician B is correct

It is safe to say that Lead acid uses sulfuric acid. When fully charged, the electrolyte consist of 40% concentrated sulfuric acid and the remainder consist of mostly water. However, as it discharges, both the positive and the negative plates turn into lead sulfate with the electrolyte loosing much of its dissolved sulfuric acid and water.

7 0
3 years ago
Read 2 more answers
Which of the following is used to store data in the computer's memory that can be
sasho [114]

The  storage that is used to store data in the computer's memory that can be used by a program later when executing instructions is variables.

<h3>What is variables?</h3>

Variables can be defined as the way or process in which data or information are store in a computer memory.

Data or information that may likely change or be altered are often stores in a computer memory storage called variables and this store data can be retrieve later for use by a program when executing instruction on the computer  system.

Inconclusion the  storage that is used to store data in the computer's memory that can be used by a program later when executing instructions is variables.

Learn more about variables here:brainly.com/question/23931018

5 0
2 years ago
How to run angular project from github.
sergiy2304 [10]

Answer:

i have no ideaaaaaaaaaaaaaaaaaaaaaa

Explanation:

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa kill me

6 0
2 years ago
_____ CRM systems are hosted by an external vendor in the vendor's data center.
PtichkaEL [24]

Answer: On- demand

Explanation:

 On demand CRM system are basically hosted by the external vendor in the vendor data center. CRM is basically stand for customer relationship management.

CRM is a strategy that are used for managing the organisation relationship with the customers.

On demand CRM define as software availability for the customers. It basically connected with the idea of software on demand. The software are modify according to the current requirement and demand.

8 0
2 years ago
What is a computer network?
Contact [7]

Answer:

A computer network is a group of two or more computers that are linked together. Networks are usually used to share resources, exchange files or communicate with other users. so A

Explanation:

7 0
2 years ago
Other questions:
  • By which method is heat transferred through a metal <br> spoon?
    9·2 answers
  • Which of the following scanning technique attackers use to bypass firewall rules, logging mechanism, and hide themselves as usua
    11·1 answer
  • The Change Speed command in Audacity lets you change which two things about a track at the same time?
    9·1 answer
  • What is the theory of trouble shooting
    10·2 answers
  • 2. What is data redundancy?
    14·1 answer
  • Remote wiping is a device security control that allows an organization to remotely erase data or email in the event of loss or t
    10·2 answers
  • What values can represent a bit
    8·1 answer
  • You are a computer consultant called in to a manufacturing plant. The plant engineer needs a system to control their assembly li
    10·1 answer
  • 3.6 Code Practice Edhesive. (PYTHON LANGUAGE)
    13·1 answer
  • Sarah used a grid to create this layout for a website. Which rule of composition did Sarah use for the grid?
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!