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
adoni [48]
3 years ago
5

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

i = 0; i < a.length; i++ ) a[ i ] = i + 2; int result = 0; for ( int i = 0; i < a.length; i++ ) result += a[ i ]; System.out.printf( "Result is: %d\n", result ); } // end main } // end class Test The output of this program will be:
Computers and Technology
1 answer:
Anna11 [10]3 years ago
3 0

Answer:

Result is: 65

Explanation:

To analyze this code let us asign line numbers:

  1. public class Test {
  2.    public static void main( String[] args )
  3.    { int[] a; a = new int[ 10 ];
  4.        for ( int i = 0; i < a.length; i++ )
  5.            a[ i ] = i + 2;
  6.        int result = 0;
  7.        for ( int i = 0; i < a.length; i++ )
  8.            result += a[ i ];
  9.        System.out.printf( "Result is: %d\n", result );
  10.    }
  11. }

On line 3, an array of ints is created of size 10

On line 4 and 5 a for loop is used to add values to the array. at the end of the execution of line 4 and 5, the array will contain the following elements: [2, 3, 4, 5, 6, 7, 8, 9, 10, 11]

On line 6 an int variable result is created and initialized to 0

line 7 and 8 allows a for loop through the array adding up all the elements of the array and assigning them to result

Line 9 outputs the value of result (Which is the total sum)

You might be interested in
What is the awnser ?
Igoryamba

Its the second one. Hope this helps.   :)

4 0
4 years ago
Choose the option that best matches the description given. The older term, social service, referred to advancing human welfare.
egoroff_w [7]

Answer:

Social Assistance

Explanation:

Provision and disbursement of intervention in other to palliate the suffering and want of an individual, group or community can be described as rendering social assistance. Assistance which also means helping people fulfill their needs could be offered by the government, non-governmental organizations or individuals personnels. Rendering social assistance could be in the form of cash or gift offerings, provision of food for the hungry, shelter for the homeless, medical interventions for the sick and catering for other touch points of the needy.

4 0
3 years ago
What permissions should you assign a group if you want the group to have the ability to read, add, delete, execute, and modify f
ratelena [41]

Answer:

Modify is the correct answer to the following question.

Explanation:

If any person or user wants to read, delete, modify and execute the files then they have required the Modify permission. In other words, Modify permission provides the user to modify and delete the following files but they unable to delete subfolders because of the following permission.  

If they want then they have to change the permission by click right button from the mouse on the file or the folders which they want to change and then click on the properties from there they can change the permission.

7 0
4 years ago
Create a plot of monthly averaged max and min temperature (columns TMAX and TMIN). That is each January in the record will be in
sertanlavr [38]

Answer:

robuk plssss

Explanation:

5 plss just 5 1=2

3 0
3 years ago
Include the source code with comments for all modules in lab. you do not have to include test bench code. code without comments
hoa [83]
I like the UCF Football coach

7 0
3 years ago
Other questions:
  • What type of socket should be used with an air impact wrench
    12·1 answer
  • Plzzzzzzz help good answers only and best answer gets brainly
    5·1 answer
  • I’m which part of a profession email should you try to be brief, but highly descriptive
    7·1 answer
  • When two or more links need to pass traffic as if they were one physical link, which of the following would be used to satisfy t
    12·1 answer
  • Respuestas de un examen parcial en introducción to computer
    12·1 answer
  • An ip address that does not change and is usuallly assigned manually is called what?
    14·1 answer
  • Edhesive assignment 4
    14·1 answer
  • Question of Computer science​
    7·1 answer
  • Question:
    6·2 answers
  • What are the benefits and drawbacks of a desktop utilising virtualisation and a server?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!