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
Vera_Pavlovna [14]
2 years ago
14

Given a scanner reference variable named input that has been associated with an input source consisting of a sequence of strings

and two int variables, count and longest, write the code necessary to examine all the strings in the input source and determine how long the longest string (or strings are). that value should be assigned to longest; the number of strings that are of that length should be assigned to count.
Computers and Technology
2 answers:
Makovka662 [10]2 years ago
7 0

The code that examines all the strings in the input source and determines how long the longest string (or strings are) is the following:

total = 0; % initial value is zero, in every while loop it will be incremented

while(input.hasNextInt()){

total += input.nextInt( );

}

BlackZzzverrR [31]2 years ago
5 0

Answer:

int count = 0;  //int variables

int longest =0;  // int variables

Scanner input = new Scanner(System.in); // given input is reference variable

String str= new String();  // creating object of sting class

while (input.hasNext()) // taking the input by using scanner reference

{

str= input.next();  // taking input in string

if (str.length() == longest) // checking condition

++count;  // increment the count

else

if (Str.length() > longest) // if string is greater then longest

{

longest = str.length(); // calculating length

count = 1;  // assign count to 1

}

}

Explanation:

Following are the description of the code :

  • Declared a two variable count and longest of  int type.
  • Create a object of String class i.e 'str".
  • Taking input in the string by using scanner reference i.e "input".
  • Finally checking the condition of if and else block and calculating the length of string and assign into longest variable.
You might be interested in
Allows a service provider organization to own and manage the infrastructure (including computing, networking, and storage device
djverab [1.8K]

Answer:

The answer is "Public Cloud computing".

Explanation:

It is a type of technology that focusing on domain-specific resources rather than using dedicated servers or intelligent machines. All services are provided as well as used throughout the Network and per user are paid, and certain options were wrong which can be described as follows:

  • In option 1, it is used to describe the details, it doesn't store data.
  • In option 2, It is used in the organization.
  • In option 3, It is used for courts or legal documentations.
7 0
3 years ago
2-3 Calculating the Body Mass Index (BMI). (Programming Exercise 2.14) Body Mass Index is a measure of health based on your weig
Luden [163]

Answer:

weight = float(input("Enter your weight in pounds: "))

height = float(input("Enter your height in inches: "))

weight = weight * 0.45359237

height = height * 0.0254

bmi = weight / (height * height)

print("Your BMI is: %.4f" % bmi)

Explanation:

*The code is written in Python.

Ask the user to enter weight in pounds and height in inches

Convert the weight into kilograms and height into meters using given conversion rates

Calculate the BMI using given formula

Print the BMI

5 0
3 years ago
The ___ appears at the bottom of the windows desktop; it is used to launch and manage programs.
asambeis [7]
<span>The taskbar appears at the bottom of the windows desktop. It is used to launch and manage programs. 
</span>The taskbar is part of the GUI (Graphical User Interface) . The most common uses of the taskbar is to<span> to locate and launch programs through the Start button, to view any program that is currently open, check the date an time.</span>
4 0
2 years ago
Which of these practices should you follow while creating your resume?
avanturin [10]

B is better than any other one's I think.

8 0
3 years ago
Read 2 more answers
13. An Internet Service Provider (ISP) is a company that builds the routers and wired connections that allow individuals to acce
valentinak56 [21]

Answer:

C. redundant networks are more reliable.

Explanation: I just got a 100 on a test and that question was asked.

7 0
2 years ago
Other questions:
  • Rachel works in a bank. She wants to present the idea of implementing an IS to the management. How should Rachel describe the IS
    9·2 answers
  • Henry Ford would have been most interested to bring which modern innovation to his automotive factories?
    5·2 answers
  • A function defined beginning with void SetNegativesToZeros(int userValues[], ... should modify userValues such that any negative
    12·1 answer
  • Write the code that creates a public class named Vehicle that has one private data member. The private data member is an integer
    13·1 answer
  • Define a function below, sum_numeric_vals, which takes a single dictionary as a parameter. The dictionary has only strings for k
    12·1 answer
  • Which type of computer operating system would be best for a large corporation?
    7·2 answers
  • If you can photoshop please text me i need help for my digital media class 7862381441
    9·1 answer
  • Write a method maxMagnitude() with two integer input parameters that returns the largest magnitude value. Use the method in a pr
    13·1 answer
  • What are the importance of Help and Support feature of Windows​
    6·1 answer
  • A coworker is taking a computer overseas and asks you what concerns he should have. What do you tell him
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!