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
katen-ka-za [31]
2 years ago
9

What is output by the following code?

Computers and Technology
1 answer:
Inessa05 [86]2 years ago
8 0
When numbers are divided, the integer portion is kept and the remainder is disregarded (meaning 10/9 would return 1). Following this format, we get the answer of <span>6 6 6 3 7 7 9 5 8 8. 
I also see that this program can be optimized because you use the same for loop twice, and both of them manipulate list elements in some way. A more optimized program would be:

</span><span>int a [] = {64 , 66 , 67 , 37 , 73 , 70 , 95 , 52 , 81 , 82};

for (int i = 0; i < a.length; i++) {
  a[i] = a[i] / 10;
  </span>System.out.print(a[i] + " ");<span>
}

Or maybe you don't need to store the list values for later on. You could do:

</span>for (int i = 0; i < a.length; i++) {
  System.out.print(a[i] / 10 + " ");
}

In any situation, your answer is choice 2.
You might be interested in
In which type of market do farmers sell their produce directly to village traders in rural areas?
Anna007 [38]

Answer:

Local Market or Primary Market.

Explanation:

The farmers sell their products to big traders in the bigger market in the urban areas. However, they also sell a part of their products to various village traders, who are located in the rural areas and can be found in local or primary markets. It's not so that they are not useful as well, as small farmers, in fact, sell the whole of their produce in the local or primary market as we know them by name. And the farmer gets a reasonable return there as well.

8 0
3 years ago
Naynar kis dhrm se sambandhit hai​
Inessa05 [86]

Answer:

Islam dharm se sabandhit

5 0
2 years ago
Read 2 more answers
How did machines get involved throughout the years?
Nataliya [291]

Answer:

Although the primary goal of a political machine is keeping itself in power rather than providing good government, machines have been responsible for restructuring city governments to centralize authority, improving facilities and services, helping to assimilate immigrant groups, and encouraging the growth of business and industry. Supporters of political machines say that they “work” and that consolidating power in the hands of a boss.

Explanation:a political machine is a political group in which an authoritative leader or small group command the support of a corps of supporters and businesses

4 0
2 years ago
Which of the following is a reliable source of information: a book recommended from my professor, britannica, a blog, or wikiped
ratelena [41]
A book recommended from your professor is a reliable source of information.
8 0
3 years ago
Write a function called st_dev. St_dev should have one #parameter, a filename. The file will contain one integer on #each line.
kodGreya [7K]

Answer:

  1. import statistics
  2. def st_dev(file_name):
  3.    with open(file_name) as file:
  4.        data = file.readlines()
  5.        numList = []
  6.        for x in data:
  7.            numList.append(int(x))
  8.        
  9.        return statistics.pstdev(numList)
  10. print(st_dev("text1.txt"))

Explanation:

The solution code is written using Python.

To ease the calculation task, we can import Python statistics module to use the pstdev method to calculate the population standard deviation of a list of numbers (Line 1).

Next, create a st_dev function that take single argument file_name (Line 3). In the function, it will open the input file and read the data line by line (Line 4-5). Create a for loop to traverse through each line of the data which is an integer and append it to numList (Line 7-8). We can pass the numList to pstdev method (Line 10) and return the resulting standard deviation value as output.

We test the function by passing a file which hold a list of integer values in each line (Line 12).

8

9

12

11

21

15

16

10

7

13

And the output we shall get is 4.019950248448356

6 0
3 years ago
Other questions:
  • In three or four sentences, describe how a person buys and sells stock.
    6·2 answers
  • Which type of security threat installs to a computer without the user's knowledge and then monitors all computer activity?
    12·2 answers
  • The Glow effect adds a blinking border around a chart.<br> t or f
    15·1 answer
  • "how do we store information in long term memory?"
    12·1 answer
  • You want to join your computer to a homegroup but you don't see any homegroups on your home network
    11·1 answer
  • What are two examples of ways an electronic record may be distributed to others?
    15·1 answer
  • CAD workstations
    11·1 answer
  • Can you get financial aid with average grades
    15·1 answer
  • True or False: <br> The object reference can be used to polymorphically store any class in Java.
    13·1 answer
  • Arrays of structures ________. Group of answer choices None of the above. are automatically passed by reference cannot be passed
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!