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
Using a "word" of 5 bits, list all of the possible signed binary numbers and their decimal equivalents that are represent able i
Vsevolod [243]

Answer:

i). Signed magnitude

Five bit representation = 11111

For positive 5 bit representation = 01111 = +15

For negative 5 bit representation = 11111 = -15

ii). One's complement

For positive 5 bit representation = 01111 =+15

For negative 5 bit representation = 10000 = -15

iii). Two's compliment

For positive 5 bit representation = 01111 = -15

For negative 5 bit representation = 10001 = +15

7 0
3 years ago
Package Newton’s method for approximating square roots (Case Study: Approximating Square Roots) in a function named newton. This
lutik1710 [3]
I’m confused what are you asking
7 0
3 years ago
What color is excel?​
Eduardwww [97]

Answer:

green

Explanation:

5 0
3 years ago
Read 2 more answers
Sometimes a virus will disable a system’s antivirus protection or add exceptions which prevent its being detected. Running an an
nikklg [1K]

Answer:

A boot-up CD or a USB

Explanation:

6 0
3 years ago
What is the name of the fifth Sims 3 expansion pack
olga2289 [7]
2 were released as part 5 for the Sims 3 Expansion Pack Series. These two packs were the Pets Expansion and the Master Suite pack which added buyable and ownable pets and hotels.
8 0
3 years ago
Other questions:
  • Header and footer elements such as worksheet name, current date, and time are _____ elements, they change as your worksheet does
    12·1 answer
  • What are the advantages and disadvantages of malware maintenance?
    12·1 answer
  • When cleaning a firearm, what end of the firearm should you generally clean from?
    11·2 answers
  • Implement a recursive program that takes in a number and finds the square of that number through addition. For example if the nu
    5·1 answer
  • 2. An evil twin attack that broadcasts a legitimate SSID for an unauthorized network is an example of what category of threat? A
    9·1 answer
  • .In Python, comments begin with the comment marker and continue ______.
    14·1 answer
  • Identify the benefit of modeling to communicate a solution.
    10·1 answer
  • What is keylogging attack?
    13·2 answers
  • From Blown to Bits why is it important to know what children are doing on the Web Tonight?
    7·1 answer
  • You arrive at school on Friday for a field trip ! What a lucky day!You need to figure out what room you are in before leaving. Y
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!