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
What type of force will cause a object to change its speed
Elena-2011 [213]
Net force also known as an Unbalanced force. 

8 0
3 years ago
How much charge passes through a wire in 4.0 s if the current is 3.0 A?
NemiM [27]

Answer:

12 coloumbs

Explanation:

Q = IT

I= 3A, T=4s

Q = 3×4 =12coloumbs

6 0
2 years ago
Identify the following physical quantities as scalars or vectors.
34kurt
Position displacement velocity acceleration are vectors and the rest are scalars
6 0
3 years ago
Read 2 more answers
An exercise program that lacks specific goals is failing what fitness principle?
lbvjy [14]
The answer is progression
6 0
3 years ago
Read 2 more answers
Water is formed when two hydrogen atoms bond to an oxygen atom. The hydrogen and the oxygen in this example are different
Goryan [66]

They both are two different elements.SO the answer is Element

8 0
3 years ago
Other questions:
  • During an exothermic process, _____. during an exothermic process, _____. no heat is exchanged between the system and the surrou
    11·1 answer
  • In outer space a five KG object moving in to the right at 4M/S and a two KG object moving to the left at 3MS collide and stick t
    13·1 answer
  • How do chemical formulas represent compounds? <br> Help PLEASE
    8·2 answers
  • Was the dirty job a chimney maker?<br> TrueOr false.
    15·2 answers
  • Que fracción de luz que llega directa a una lamina de vidrio se refleja en la primera superficie?
    6·1 answer
  • Energy that moves from a warmer object to a cooler object is called _______
    15·1 answer
  • Explane Information-processing approach
    5·1 answer
  • How much heat transfer is necessary to raise the temperature of a 13.6 kg piece of ice from −20.0ºC to 130ºC? specific heat capa
    10·1 answer
  • A 4.0-kilogram block, initially at rest, is acted upon by an 8.0 newtons force for 10 seconds. How far, in meters, will the mass
    9·1 answer
  • A frictionless toy car is placed on a ramp, which is inclined at an unknown angle with respect to the horizontal. Starting from
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!