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
Darius' boat sails into the harbor with a speed of 80m/s. After 20 seconds, Darius' boat has come to a stop at the dock. What is
Novosadov [1.4K]

Answer:

The boat's acceleration is 4 m/s²

Explanation:

This question seeks to test the knowledge of acceleration and how to calculate acceleration when the speed is provided. Hence, the formula for acceleration would be used here.

Acceleration (m/s²) = speed (in m/s) ÷ time (in seconds)

Acceleration = 80 m/s ÷ 20 secs

Acceleration = 4 m/s² or 4 ms⁻²

The boat's acceleration is 4 m/s²

4 0
2 years ago
Identify the relationship between strong forces and electric forces in the nucleus.
Triss [41]

Answer:

C

Explanation:

The strong force holds together quarks, the fundamental particles that make up the protons and neutrons of the atomic nucleus, and further holds together protons and neutrons to form atomic nuclei. As such it is responsible for the underlying stability of matter.

5 0
3 years ago
What is a formula unit​
Nana76 [90]

A formula unit is the empirical formula for an ionic compound. It is the lowest possible ratio of the cations and anions of a given ionic compound.

3 0
3 years ago
On which planet would your weight be the most and the least?
hoa [83]

Answer:

Jupiter and neptune

Explanation:

6 0
3 years ago
Explain how you can cause light separated by a prism to combine
r-ruslan [8.4K]
When you shine a lite through a prism is reflects out light through all of the edges and causes light separation. Or just simply shine a laser through the edge of a sideways piece of glass.

I hope that this was helpful for you.
7 0
3 years ago
Other questions:
  • During a fission each time an atom divides ___.
    5·2 answers
  • Which of the following is an example of kinetic energy?
    6·1 answer
  • If the mass of a material is 45 grams and the volume of the material is 10 cm^3, what would the density of the material be
    9·1 answer
  • a plane travels a total distance of 1,223. If the the plane travels 460 mph for 75 minutes. Then, how long in minutes does it tr
    10·1 answer
  • A cannonball is fired across a flat field at an angle of 43 degrees with an initial speed 32 m/s and height of 12 m.
    6·1 answer
  • What makes the id different from the superego?
    10·1 answer
  • An object undergoing simple harmonic motion takes 0.40 s to travel from one point of zero velocity to the next such point. The d
    14·1 answer
  • A 6000 kg rocket is launched vertically from the ground. If the exhaust speed is 1000 m/s, how much gas must be ejected each sec
    9·1 answer
  •  Why are radio waves safer to humans than X- Rays
    8·1 answer
  • Between the orbits of Mars and Jupiter, several thousand small objects called asteroids move in nearly circular orbits around th
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!