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
Assume that a is an array of two or more integers, and that b and c are integers.
deff fn [24]

Answer:

B contains the highest value in the array

Explanation:

Such that the first if statement will execute and like wise the second if statement will execute thereby increasing the value of b

4 0
3 years ago
How to count the total number of users from backend reactjs.
igomit [66]

Explanation:

If you are only using firebase auth, you can use the listUsers function of the admin module (limited to 1000 items per page).

3 0
2 years ago
Which type of graph or chart will you use to show changes in data points?
likoan [24]
You would use a line graph because, line graphs show you the slope. The slope represents a change in data.
6 0
3 years ago
CottonPlus, a sportswear company, is releasing a new casual sportswear line. The company approaches a basketball star to endorse
Airida [17]

Answer: Tactics

Explanation:

  According to the given question, the tactics is one of the type of element of the given program planning that helps in illustrating the given scenario as by using the various types of tactics marketing approach we can easily promote the products in the market.

  • The tactics is one of the legal or authorized element which deals with the new products in the market.
  • In the given scenario, the Cotton Plus is one of the sportswear organization and the main strategy of the company is to approach the basketballs stars for promoting their latest collection.

 Therefore, Tactics is the correct answer.

3 0
3 years ago
HURRY PLS
gogolik [260]

Answer:

the testing team

Explanation:

because even though she may have fulfilled the requirements but she still need to test if it runs perfectly or not

7 0
1 year ago
Other questions:
  • Days of the week are represented as three-letter strings ("Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"). Write a javaScript f
    14·1 answer
  • Explain how Deep Packet Inspection works (DPI). How is this technology beneficial to Perimeter Security? Lastly, describe a scen
    6·1 answer
  • Henrietta, the owner of a very successful hotel chain in the Southeast, is exploring the possibility of expanding the chain into
    15·1 answer
  • Which of the following controls will provide an area in the form for the user to enter a name? a. button b. label c. text box d.
    8·1 answer
  • When specifying keywords to conduct an internet search, which of the following parts of speech will be the most useful??
    6·1 answer
  • Amazon Web Services and Microsoft Azure are some of the most widely used _______.
    7·1 answer
  • Where does the list of incoming mail appear in gmail
    13·2 answers
  • Which of the following situations would not require knowledge of networking?
    11·2 answers
  • Create an application named SalesTransactionDemo that declares several SalesTransaction objects and displays their values and th
    12·1 answer
  • If you select one slice of pie in a pie chart, you have selected a ____
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!