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
lys-0071 [83]
3 years ago
7

Assign the size of userInput to stringSize. Ex: if userInput is "Hello", output is: Size of userInput: 5

Computers and Technology
1 answer:
Basile [38]3 years ago
8 0

Answer:

import java.util.Scanner;

public class StringSize {

  public static void main (String [] args) {

     Scanner scnr = new Scanner(System.in);

     String userInput;

     int stringSize;

     userInput = scnr.nextLine();

     

     /* Your solution goes here  */

     

     stringSize = userInput.length();

     

     System.out.println("Size of userInput: " + stringSize);

     return;

  }

}

Explanation:

stringSize = userInput.length();  //  userInput.length() will get the length of the string and  put in stringSize

You might be interested in
"what is the #1 resource used when researching a product online?"
BARSIC [14]
I believe it would be customer reviews.
6 0
3 years ago
The method "someOtherMethod" is NOT defined as static. This means...
Verdich [7]

Answer:

3

Explanation:

7 0
3 years ago
Help please appreciate it
Lelechka [254]
D you can change the text box size if you need to include more text
3 0
3 years ago
List 10 programs or applications on your computer other than any Microsoft office programs
Fofino [41]
Dropbox
Mozilla Firefox, Google Chrome
Gmail, Mozilla Thunderbird
CDburnerXP
Putty, Netflix,
Paint.net, Filezilla
3 0
3 years ago
Capstone Project part 11 quiz
kobusy [5.1K]
It is checking if the response is not yet yes
4 0
2 years ago
Other questions:
  • How many possible values will an eight bit audio sample have
    14·1 answer
  • what is the first step you would take when troubleshooting an external network, such as an internet connection issue?
    13·2 answers
  • Want to network 2 laptops togetger using ethernet cable...But it won't connect
    9·1 answer
  • A blog is Group of answer choices a character in Lineage,
    15·1 answer
  • Suppose Alice and Bob are sending packets to each other over a computer network. Suppose Trudy positions herself in the network
    8·1 answer
  • In PowerPoint, Jake wants to change the slide background to a photo on his computer. He is walking through a tutorial given to h
    7·1 answer
  • The art element line is a moving point.<br><br><br> True or False
    15·1 answer
  • Select the items below that are examples of things that could use the smart card technology.
    7·1 answer
  • Which of the following is/are used in multimedia?
    14·1 answer
  • Scott sends his backups to a company that keeps them in a secure vault. What type of backup solution has he implemented?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!