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
Assign listNodes with all elements with a clasa name prog-lang
ra1l [238]

Using the knowledge in computational language in JAVA it is possible to write a code that Assign listNodes with all elements with a clasa name prog-lang

<h3>Writting in JAVA:</h3>

let listNodes;

 //assigning listNodes with all elements with a class name of 'special-language'

  listNodes = document.getElementsByClassName('special-language');

 //for loop to traverse all node in listNodes and print every element in it with class name special-language

 for (let i = 0; i < listNodes.length; i++) {

     console.log(listNodes[i].innerHTML);

 }

See more about JAVA at brainly.com/question/12975450

#SPJ1

8 0
1 year ago
In the Programming Process which of the following is not involved in defining what the program is to do:_____________ Group of a
Andrew [12]

Answer:

a. Compile code

Explanation:

In programming process, the following are important in defining what a program is to do;

i. Purpose: The first step in writing a program is describing the purpose of the program. This includes the aim, objective and the scope of the program.  The purpose of a program should be defined in the program.

ii. Input: It is also important to specify inputs for your program. Inputs are basically data supplied to the program in order to perform a task. Valid inputs are defined in the program.

iii. Output: Many times, when inputs are supplied to a program the resulting effects are shown in the outputs. The way the output will be is defined in the program.

iv. Process: This involves the method by which inputs are being mapped into outputs. The process implements the functionality of the program by converting inputs into their corresponding outputs. The process is defined in the program.

Compile code is not a requirement in defining what a program is to do. It just allows the source code of the program to be converted into a language that the machine understands.

5 0
3 years ago
How can website illustrate cooperations and kidness?
Brilliant_brown [7]
It can illustrate cooperation's and kindness by allowing many different people and strangers to post their opinions and thoughts as long as they are being positive about it! Hope i helped
8 0
3 years ago
Skylar is viewing her personal and business calendar in a side-by-side fashion, but she would like to view a single calendar tha
pogonyaev

Answer:

The solution for the current situation in which Skylar is viewing her personal and business calendar in a side-by-side fashion, but she would like to view a single calendar that has appointments and meetings from both personal and business. is:

Configure the Overlay option.

Explanation:

The reasons behind this answer are that in the first place, creating another calendar is too much work. In the second place, the share of the calendars is not going to help her because that would only allow someone else to watch her calendars. However, using the overlay option will allow her to mix them and create one calendar with all her information.

8 0
3 years ago
To use   ( 2 complement ) answer it (101101)2 – (1100)2 =   (                    )2
Tju [1.3M]

Answer:

2(101101) - 2(1100) = 200002

Explanation:

the text is everywhere don't know what to answer

5 0
2 years ago
Other questions:
  • I plugged my phone up into a charger, the charger sparked and i unplugged my phone and now it wont charge at all, does anyone kn
    13·1 answer
  • James has been asked to build a low-profile computer for his friend to use as a home theater system. James needs to choose parts
    15·1 answer
  • The unique global address for a web page or other resource on the internet is called the ________.
    7·1 answer
  • Which one of these do not belong on the Do's list in Helpful Hints when preparing a presentation: Which one of these do not belo
    8·1 answer
  • Public static String doSomething(String s) { final String BLANK = " "; //BLANK contains a single space String str = ""; //empty
    6·1 answer
  • Which wildcard characters will return a single character when using the Find dialog box?
    6·2 answers
  • You are a network engineer tasked with performing a site survey for a multiple-channel architecture (MCA) system in a three-stor
    11·1 answer
  • Consider the following code segment.
    12·1 answer
  • Desktop and personal computer are also known as​
    7·1 answer
  • Help me please. I dont really understand this.
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!