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
EastWind [94]
2 years ago
12

Write an application that counts the total number of spaces contained in a quote entered by the user.

Computers and Technology
1 answer:
mylen [45]2 years ago
3 0

Answer:

Explanation:

The following code is written in Java. It asks the user for an input and saves it in a String variable. Then it loops through all the characters in the string and counts the spaces. Finally, it prints the total number of spaces in the String.

public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

       System.out.println("Enter Line Now:");

       String userInput = in.nextLine();

       int spaceCount = 0;

       for (int x = 0; x < userInput.length(); x++) {

           if (userInput.charAt(x) == ' ') {

               spaceCount++;

           }

       }

       System.out.println(spaceCount);

   }

You might be interested in
What is pressure?
Licemer1 [7]
"force per unit area" because pressure is force per unit area.

hope this helped
6 0
3 years ago
Read 2 more answers
Rachelle's computer has frequent system crashes and it takes a long time to access files and folders. What hardware component is
9966 [12]
System crashes, viruses and fragmented file systems are hallmarks of Windows systems, but your teacher is probably looking for Hard Drive for the answer.
8 0
3 years ago
What is typically unique in each database table?
andriy [413]

ID number APEX  answer

4 0
3 years ago
Read 2 more answers
What term describes the process of transferring information from one computer to another
Flauer [41]

Syncing or maybe FTP or connection

5 0
3 years ago
Let's consider a long, quiet country road with houses scattered very sparsely along it. (We can picture the road as a long line
Rus_ich [418]

Answer:

Follows are the solution to these question:

Explanation:

A simple gullible algorithm is present. Let h mark the house to the left. Then we put a base station about 4 kilometers to the right. Now delete and repeat all the houses protected by this base station. In this algorithm, they can simply be seen to position baselines at b1, . . , bk as well as other algorithms (which may be an optimum algorithm) at b'_{1}, \ . . . . . . ,b'_{k'}  and so on. (from left to right)   b_1 \geq b'_{1},\ \  b_2 \geq b'_{2} That's why k \leq k'.

7 0
2 years ago
Other questions:
  • What's the ASCII code for boy ?
    15·1 answer
  • Consider the cement used for the foundation; the bricks and timber used for the walls; and the shingles used for the roof. All o
    5·1 answer
  • Is a process in which an attacker attempts to acquire information about your network and system by social means, such as talking
    9·1 answer
  • ____________ facilitates the processes that help an organization function by applying information and communication technologies
    5·1 answer
  • Assume that sentence is a variable that has been associated with a string consisting of words separated by single space characte
    12·2 answers
  • .Choose the extention of Scratch Project<br><br><br> .sb2<br><br> jpeg<br><br> .exls
    5·2 answers
  • You work in an office that uses Linux and Windows servers. The network uses the IP protocol. You are sitting at a Windows workst
    13·1 answer
  • All parking revenue comes from a home teams games? True or false
    5·1 answer
  • Dragging a mouse over text is called
    9·1 answer
  • If “A” represents in binary 10011001, what will be the value of word “CAB”?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!