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
Is Brainly cheating??
Vanyuwa [196]

Answer: What do you mean?

6 0
3 years ago
Read 2 more answers
Ron is in the process of designing tables for a database that will contain information for all school matches played in a year.
solong [7]
Primary Key, if we define field as primary key it will not accept duplicate values.<span>
</span>
6 0
3 years ago
The ________ contains the central electronic components of the computer. select one:
Sati [7]
The motherboard contains the central electronic components of the computer.
6 0
3 years ago
Which type of classroom enable students to attend lectures without being physically present with the teacher
wlad13 [49]
Online classroom..................
8 0
3 years ago
Read 2 more answers
Which option can be used to automatically scan a document to prepare it for publishing, identifying personal information that sh
lubasha [3.4K]

Answer:

Document Inspector  option can be used to automatically scan a document to prepare it for publishing, identifying personal information that should be removed

Explanation:

Document scanner: This converts the text written in the paper in to a digital form. Most probably it will convert the text in paper in to image only.

Document Inspector is the tool which removes the personal information while sharing the document. The personal information can be name, mail id, phone number etc. This personal information though hidden will get reflected while publishing and this document inspector allow us to protect these data from sharing.

Privacy manager: This is a software reducing the risk of unauthorized access of data

Security manager: This once again protect the document.

4 0
4 years ago
Other questions:
  • A car moves down the street at 45 kph. The driver takes his foot off the gas pedal but does not brake. Which is the correct expl
    5·2 answers
  • When is a wrecker considered to be an emergency vehicle?
    12·1 answer
  • The elements of an integer-valued array can be set to 0 (i.e., the array can be cleared) recursively as follows: An array of siz
    8·1 answer
  • What do developers do to support software products
    14·1 answer
  • What are the careers needed to create a video game? Name all the careers involved please.
    15·1 answer
  • Intellectual property piracy has gotten a small boost from the increasing availability of counterfeit goods through Internet cha
    14·1 answer
  • Write two methods: encrypt and decrypt. encrypt should #take as input a string, and return an encrypted version #of it according
    6·1 answer
  • All websites with medical information should be considered credible.
    15·2 answers
  • A document that summarizes and displays data is called a: Group of answer choices Report Procedure Form Requirement
    15·1 answer
  • Which two extensions in scratch are correctly matched to their accessibility goals
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!