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
With the cold winter months fast approaching, Lungi wants to improve the overall effectiveness of operations at his NGO. He want
igor_vitrenko [27]
There would not be enough blankets
5 0
2 years ago
Which term refers to a cloud-native, streamlined technology for hosting cloud-based applications, where a server runs for short
PilotLPTM [1.2K]

Answer:

Serverless computing.

Explanation:

Cloud computing can be defined as a type of computing that requires shared computing resources such as cloud storage (data storage), servers, computer power, and software over the internet rather than local servers and hard drives.

Generally, cloud computing offers individuals and businesses a fast, effective and efficient way of providing services.

Cloud computing comprises of three (3) service models and these are;

1. Platform as a Service (PaaS).

2. Infrastructure as a Service (IaaS).

3. Software as a Service (SaaS).

The three (3) main characteristics of cloud computing are;

I. Measured service: it allows cloud service providers to monitor and measure the level of service used by various clients with respect to subscriptions.

II. Resource pooling: this allows cloud service providers to serve multiple customers or clients with services that are scalable and provisional.

III. Elasticity: this is the ability of the cloud computing service to be flexible and adaptive to the traffic or requests from the end users.

Serverless computing is a term which refers to a cloud-native and streamlined technology that is designed typically for hosting cloud-based applications, in which a server operates for short bursts only when needed by an application or service. Serverless computing is used for the allocation of machine resources on demand.

8 0
3 years ago
____ privileges for data involve establishing who can enter new data, change existing data, delete unwanted data, and view data.
Stolb23 [73]
Administrator privileges
6 0
3 years ago
The _________________________ contains the program necessary for the computer to start up and a description of how the hard driv
lawyer [7]
Hard Disk Drive would be the answer. 
8 0
3 years ago
I want to do is speed test to do i go to for my computer
sdas [7]

speedtest.net

Explanation:

aaaaads

8 0
3 years ago
Read 2 more answers
Other questions:
  • 1. W jaki sposób można wyrównać tekst po wstawieniu tabulatora?
    6·1 answer
  • What is an oxidation state?
    15·1 answer
  • The packets used to transmit voice on the Internet are similar to the packets that are used to send email. What are some of the
    7·1 answer
  • What are some differences between CUI and GUI ?
    7·1 answer
  • What is the easiest way to create a resume in Word with predefined content that can be replaced with your information?
    13·2 answers
  • For the preceding simple implementation, this execution order would be nonideal for the input matrix; however, applying a loop i
    6·1 answer
  • An accompanying ____ gives audience members reference notes and review material for your presentation.
    6·1 answer
  • 7) Which of the following factors determines the structure, features, and functions of an information system used in a company?
    7·1 answer
  • What is a fire wall and how does it work
    6·1 answer
  • In programming 2+6 is an example of what math
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!