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
Ainat [17]
3 years ago
6

Write code which takes a sentence as an input from the user and then prints the length of the first word in that sentence.

Computers and Technology
1 answer:
Afina-wow [57]3 years ago
7 0

import java.util.Scanner;

public class U2_L3_Activity_Four {

   public static void main(String[] args) {

       Scanner scan = new Scanner(System.in);

       System.out.println("Enter a sentence.");

       String sent = scan.nextLine();

       int count = 0;

       for (int i = 0; i < sent.length(); i++){

           char c = sent.charAt(i);

           if (c != ' '){

               count++;

       }

           else{

               break;

           }

       

   }

       System.out.println("The first word is " + count +" letters long");

   

   }

}

We check to see when the first space occurs in our string and we add one to our count variable for every letter before that. I hope this helps!

You might be interested in
What’s your fave tv show?
kompoz [17]

Answer:

the vampire diareas

Explanation:

7 0
3 years ago
Read 2 more answers
A _____ is a modeling tool used in structured systems analysis and design (SSAD) analysis model that helps break down a complex
Shalnov [3]

A <em>"DATA FLOW DIAGRAM"</em> is a modeling tool used in structured systems analysis and design (SSAD) analysis model that helps break down a complex process into simpler, more manageable, and more understandable subprocesses

8 0
3 years ago
Do you agree that digital signatures are the best way to protect the data in question?
lutik1710 [3]

Answer:

Explained

Explanation:

Yes, I agree that digital signatures are the best way to protect the data in the date in question. A digital signature is mathematical technique used to validate the authenticity and integrity of a massage. Digital signature is far more inherent security. It is built to solve problems of tempering and impersonation of digital documents. It allows the authorized user to have authentic right, and the unauthorized person is denied access.

3 0
3 years ago
What is inputted into a computer system?
Anna [14]

Answer:

Hey mate.....

Explanation:

This is ur answer.....

<em>Input refers to any information, or data, that is sent to a computer for processing. Input is often sent to the computer from a device such as a keyboard, mouse, or other input device. Putting it simple, input is the act of entering data into a computer.</em>

<em />

Hope it helps!

Mark me brainliest....

FOLLOW ME!!!! :)

4 0
3 years ago
____ map a set of alphanumeric characters and special symbols to a sequence of numeric values that a computer can process.
Neporo4naja [7]
The answer is : coding schemes
4 0
3 years ago
Other questions:
  • Ascending and descending are examples of
    5·2 answers
  • People often delete or read email based upon the subject line alone select one:
    10·2 answers
  • ​For complex models, analysts can choose computer-based modeling tools that use _____, which includes standard shapes and symbol
    10·1 answer
  • To see all of the records at once, you should use _______ view. 
    12·2 answers
  • Describe the functions of ALU, resisters, CU, BIU, Cache and FPU.
    7·1 answer
  • An organization is trying to decide which type of access control is most appropriate for the network. The current access control
    12·1 answer
  • The term ____ describes primary storage devices that are implemented as microchips, can read and write with equal speed, and can
    8·1 answer
  • Cloud suites are stored on your hard drive and are available anywhere you can access the Internet
    15·1 answer
  • Plz tell the answer I I'll mark u as the brainliest
    14·1 answer
  • What was the name of the first personal computer and what year was it introduced
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!