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
Bob flys a drone which has a 20 megapixel camera attached, what is the definition of "megapixel in this context? Why does it mat
Verizon [17]

Answer:

megapixel refers to the unit of resolution i.e. one million

Explanation:

Interestingly the higher the pixels does not mean higher quality of image, it's more about the camera and it's sensor.

I am a photographer and a licensed drone pilot and have researched the subject to help with camera choice, both DSLR and drone.

5 0
3 years ago
Complete the sentence.
Luda [366]
The answer is Tablets
6 0
3 years ago
Which of the following is a right of a user of information systems?
Eva8 [605]

Answer:

Option A is the correct option for the following question.

Explanation:

The following option is correct because this option is one of among four rights of the user of an information system which is collectively important for those users who working in any organization, company or firm. It always requires the new and the upcoming features or the function of the system.

Option B is wrong because it is not the right of the user and the right is don't disclose the secrets of your firm or company to any outsiders or any person who are not reliable.

Option C is wrong because it is not the right of the user.

Option D is wrong because it is not the right of the user and it is the responsibility of all computer users to keep their systems fit and fine.

4 0
4 years ago
Select the correct answer.
lisov135 [29]

Answer:

D. Prepare the content

Explanation:

Before Jennifer starts designing the website she has to prepare content for the website

5 0
3 years ago
Read 2 more answers
You are designing a network for a client. As part of the design you need setup a Site to Site VPN solution to a Branch office. T
MaRussiya [10]

Answer:

The branch office needs to configured as a split tunnel to allow local connectivity and internet connectivity

Explanation:

Split tunneling is a computer networking concept which allows a network terminal to access different network domains or subnets like a public network  and a local network at the same time so that the networked system can access local as well as remote locations without changing the overall network configuration.  

5 0
4 years ago
Other questions:
  • Jane is a full-time student on a somewhat limited budget, taking online classes, and she loves to play the latest video games. S
    12·1 answer
  • 6. Which of the following is malware? (1 point)
    10·2 answers
  • Hey! Would you please help me do this program?
    14·1 answer
  • Explain what a wiki is and list its advantages.
    5·1 answer
  • As in algebra, you can use brackets to override the order of operations Excel follows to perform formula calculations. True or f
    13·1 answer
  • Which task should happen during the planning stage of a project? reflect on the project outcomes prevent set-backs determine the
    11·1 answer
  • What is a feature of Print Preview?
    12·1 answer
  • Who is the father of computer​
    7·1 answer
  • Does speedtest report megabytes per second or megabits
    6·1 answer
  • Let cell E2 = 100, what is the result of this formula? =NOT(E2<100) *
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!