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
Discuss the importance of top management commitment and the development of standards for successful project management. Provide
sasho [114]

Answer:

Significance of top administration responsibility: Top administration duty assumes an indispensable job in the development of any association. The duties of top administration decied the future objective of the association. So we can say that the development of association is straightforwardly proportional to the duties set by the top administration.

The viable and effective headings and the duties bargains the association to achive the arranged objectives and the objectives.

Improvement of Standards: Development of norms are likewise significant in any association. The quality check of the association or the review is being finished dealing with the these measures. So we can say that the nature of association is estimated on the bases of norms set. That is the reason its essential to set the gauges

initially, characterize the measures and flow it inside the association. Since it by implication sway the nature of any association.

For example if we are developing any project that its important that we should be clear about the expectation and commitments set by the top management regarding the

project and it should be developed on the standards set by the organization. Because without these two fators it may happen that our project fails in real

scenario

1. Difficulties in regards to asset the board.

2. Difficulties with respect to cost and budgetary needs

3. Difficulties in regards to innovations and skiils

4. Difficulties in regards to convenient conveyance of the task

Explanation:

4 0
3 years ago
Choose the missing method name.
leva [86]

Answer:

midpoint i'm pretty sure. :)

Explanation:

3 0
2 years ago
The piston engine uses the ________ to convert the reciprocating motion of the piston into rotary motion.
PSYCHO15rus [73]

The piston engine uses the crankshaft to convert the reciprocating motion of the piston into rotary motion.

<span>The crankshaft is used to convert reciprocating motion of the piston into rotary motion, while the conversion process is called torque, which is a twisting force. Aside from crankshaft, there are a total of four parts of the engine that work together in order to convert the reciprocating motion into rotary motion namely cylinder, or also called the chamber of the piston, the piston itself, and the connecting rod.</span>

5 0
3 years ago
Write a program that defines an interface having the following methods: addition, subtraction, multiplication, and division. Cre
Tatiana [17]

Hello, you haven't provided the programing language in which you need the code, I'll explain how to do it using Python, and you can follow the same logic to make a program in the programing language that you need.

Answer:

1. # -*- coding: utf-8 -*-

2. #Python  

3. class Calculator:

4.     def add(self):

5.         print(a + b)

6.     def sub(self):

7.         print(a - b)

8.     def mul(self):

9.         print(a * b)

10.     def div(self):

11.         print(a / b)

12.  

13. obj = Calculator()

14. choice = 1

15. while choice != 0:

16.     a = int(input("\nEnter first number: "))

17.     b = int(input("Enter first number: "))

18.      

19.     print("\n0. EXIT")

20.     print("1. DIVISION")

21.     print("2. ADDITION")

22.     print("3. SUBTRACTION")

23.     print("4. MULTIPLICATION")

24.      

25.     choice = int(input("\nEnter your choice: "))

26.     if choice == 1:

27.         obj.div()

28.     elif choice == 2:

29.         obj.add()

30.     elif choice == 3:

31.         obj.sub()

32.     elif choice == 4:

33.         obj.mul()

34.     else:

35.         break

Explanation:

  • From lines 1 to 12 we define the object with four methods, addition, subtraction, multiplication, and division. Each method contains the operation between two variables inside a print function
  • On line 13 we instantiate our class
  • On line 14 we declare the variable choice that is going to store the operation that the user wants to perform
  • On line 15 we declare a while loop, this is going to keep running the program until the user wants to exit
  • From line 16 to 18 we ask the user to enter two numbers
  • From line 19 to 24 we print the possible operation, assigning a number for each operation, this indicates to the user what number to press for what operation
  • On line 25 we ask the user for the operation
  • From lines 26 to 35 we check the user input an accordingly we call the corresponding method to performs the operation
7 0
3 years ago
Your boss asks you to transmit a small file that includes sensitive personnel data to a server on the network. The server is run
mel-nik [20]

Answer:

a. Telnet transmissions are not encrypted.

Explanation:

Indeed, since <em>Telnet transmissions are not encrypted,</em> all the information sent, and even the characters typed in the telnet console are sent in clear text.

This is a security issue, since any other device in the same network will receive a copy of the information (packets) sent. For default, all the devices, except for the server expecting to receive the information, will discard the packets. However it is easy to actively <em>listen </em>and keep those packets, wich will contain the information in plain text and human readable.

4 0
3 years ago
Other questions:
  • A student is helping a friend with a home computer that can no longer access the Internet. Upon investigation, the student disco
    9·1 answer
  • What is the absolute pathname of the YUM configuration file? REMEMBER: An absolute pathname begins with a forward slash
    12·1 answer
  • Which of these computers was marketed as a computer/game machine?
    15·2 answers
  • What are advantages and disadvantages of developing a more robust Internet of Things and continuing to add more smart nodes?
    10·1 answer
  • Which systems provide a single, cohesive platform
    11·1 answer
  • Given the availability of an ofstream object named output, write the other statements necessary to write the string "3.14159" in
    8·1 answer
  • Which is a false statement considering copyright law?
    13·2 answers
  • 15 _____ 3 = 0 Question 11 options: a) / b) % c) * d) //
    12·1 answer
  • Rohan is creating a presentation with at least 50 slides. He wants the slides to use a consistent layout and formatting. Which o
    12·1 answer
  • What is are the most efficient ways to make a slide presentation?
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!