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
laiz [17]
3 years ago
8

Consider the program below:public class Test{ public static void main(String[] args) {Int[] a;a = new int[10];for(int i = 0; i &

lt; a.length; i++)a[i] = i + 2;int result = 0;for(inti = 0; i < a.length; i++)result += a[i];System.out.printf("Result is: %d%n", result); } }The output of this program is:a. 62b. 64c. 65d. 67
Physics
1 answer:
ivolga24 [154]3 years ago
6 0

Answer:

c. 65

Explanation:

The output is 65.

An array of length 10 is created first. Then, the first for-loop fill the array with different values; The array element now become: 2, 3, 4, 5, 6, 7, 8, 9, 10, 11. The array element are generated using the equation a[i] = i + 2; so when i is 0, 1, 2, 3, 4, 5, 6, 7, 8, 9. i must be less than the array length (10).

a[0] = 0 + 2 = 2

a[1] = 1 + 2 = 3

a[2] = 2 + 2 = 4

a[3] = 3 + 2 = 5

a[4] = 4 + 2 = 6

a[5] = 5 + 2 = 7

a[6] = 6 + 2 = 8

a[7] = 7 + 2 = 9

a[8] = 8 + 2 = 10

a[9] = 9 + 2 = 11

result variable is declared and initialized to 0.

The second for-loop goes through the array and add individual element to result.

You might be interested in
Examine the scenario.
vovangra [49]

Answer:

acceleration 8 km/h/s south

Explanation:

First of all, let's remind that a vector quantity is a quantity which has both a magnitude and a direction.

Based on this definition, we can already rule out the following two choices:

distance: 40 km

speed: 40 km/h

Since they only have magnitude, they are not vectors.

Then, the following option:

velocity: 5 km/h north

is wrong, because the car is moving south, not north.

So, the correct choice is

acceleration 8 km/h/s south

In fact, the acceleration can be calculated as

a=\frac{v-u}{t}

where

v = 40 km/h is the final velocity

u = 0 is the initial velocity

t = 5 s is the time

Substituting,

a=\frac{40 km/h-0}{5 s}=8 km/h/s

And since the sign is positive, the direction is the same as the velocity (south).

7 0
3 years ago
The amount of the lighted side of the moon you can see is the same during
attashe74 [19]

<u>Answer:</u>

The amount of the lighted side of the moon you can see is the same during "how much of the sunlit side of the moon faces Earth".

<u>Explanation:</u>

The Moon is in sequential rotation with Earth, and thus displays the Sun, the close side, always on the same side. Thanks to libration, Earth can display slightly greater than half (nearly 59 per cent) of the entire lunar surface.

The side of the Moon facing Earth is considered the near side, and the far side is called the reverse. The far side is often referred to as the "dark side" inaccurately but it is actually highlighted as often as the near side: once every 29.5 Earth days. During the New Moon the near side becomes blurred.

5 0
3 years ago
The force that causes an impulse and a force that causes a change in momentum are?
Aleks [24]
I don't understand the question but impulse and momentum is the same. So maybe is the force same too
3 0
3 years ago
Read 2 more answers
PLZ HELP ITS A TIMED TEST!!!!!!!!!!!!!!!!
sergij07 [2.7K]
Image #3 good luck!!!!!!!!!!!
7 0
3 years ago
What does it mean for something to have charge?
Lana71 [14]
The property of matter that is responsible for electrical phenomena, existing in a positive or negative form.
8 0
2 years ago
Read 2 more answers
Other questions:
  • What is it called when a surface takes light in without reflecting it
    12·2 answers
  • Set the mass of person one at 10 kg and the mass of person two at 10 kg. The two
    7·1 answer
  • An exothermic reaction is taking place in a test tube what would you expect to feel when you touch the outside of the test tube
    12·1 answer
  • Suppose you are navigating a spacecraft far from other objects. The mass of the spacecraft is 2.6 × 104 kg (about 26 tons). The
    8·1 answer
  • Consider the following cyclic process carried out in two steps on a gas. Step 1: 44 J of heat is added to the gas, and 20. J of
    10·1 answer
  • A disk with a diameter of 0.05 m is spinning with a constant velocity about an axle perpendicular to the disk and running throug
    5·1 answer
  • A car travels 100 m while decelerating to 8 m/s in 5 s.<br> a) What was its initial speed?
    9·1 answer
  • ) Distinguish between scalar and vector<br>quantities<br>​
    11·1 answer
  • HELP PLEASEEEE How might the concept of momentum be applied to seafloor spreading?
    15·2 answers
  • Describe the kinetic molecular theory
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!