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
You have been hired by an educational software company to create a program that automatically calculates the sum of each place-v
Vinvika [58]

Hi, you haven't provided the programing language, therefore, we will use python but you can extend it to any programing language by reading the code and the explanation.

Answer:

n1 = int(input("First numeber: "))

n2 = int(input("Second numeber: "))

for i in range(5):

   r1 = n1%10

   r2 = n2%10

   print(r1+r2)

   n1 = n1//10

   n2 = n2//10

 

Explanation:

  1. First, we ask for the user input n1 and n2
  2. We create a for-loop to calculate the sum of each place-value of two numbers
  3. We obtain the last number in n1 by using the mod operator (%) an the number ten this way we can always take the last value, we make the same for n2
  4. Then we print the result of adding the last two numbers (place value)
  5. Finally, we get rid of the last value and overwrite n1 and n2 to continue with the process

4 0
3 years ago
You just installed a new application but users cannot connect to the application remotely. Which feature should be checked to en
qwelly [4]

Answer:

Allow an app or feature through windows firewall

Explanation:

This one had me thinking for a second. But i believe this is the correct answer. Don't quote me though lol. First you must know what a feature is, this is the section on the left hand side when you are inside of this step for the lab. It is the first thing listed from withing this function. Hope this helps!!!

4 0
3 years ago
Even though the Certified Information Systems Security Professional (CISSP) certification is not geared toward the technical IT
nirvana33 [79]

Answer:

True

Explanation:

Even though the Certified Information Systems Security Professional (CISSP) certification is not geared toward the technical IT professional, it has become one of the standards for many security professionals is a true statement.

7 0
3 years ago
In data flow diagrams, an individual who originates data is:
NemiM [27]
B. A data source is the answer. Hope it’s right.
3 0
4 years ago
_________ is the biggest problem you can face if you don’t identify the scope of your risk management project. Scope creep Nonco
mart [117]

Answer: Scope creep

Explanation:

 Scope creep in the project management basically refers to the uncontrolled development or growth in the project creep. It basically occur when the project scope are not appropriately defined.

It usually involve lack of change in the control system and increase the complexity of the project. It is also has poor requirement analysis.

So, that is why it is the biggest problem we usually face in the project management.

5 0
3 years ago
Other questions:
  • After typing “application letter” in the Search window in the New dialog box, Nate clicks the Education category. Three letters
    9·1 answer
  • Monica is teaching herself to paint. What web resource would be the most helpful
    14·1 answer
  • Explain the term DNS(Domain Name System) and why it is used.
    9·1 answer
  • What is the function of napier's bones<br>​
    8·1 answer
  • ​open-source software is​ ________.
    11·1 answer
  • Which job role requires you to create user guides for computer products and services?
    13·2 answers
  • Analyze the following code.
    10·1 answer
  • 1. Assume that in an implementation of the RSA cryptosystem one modular squar- ing takes 75% of the time of a modular multiplica
    15·1 answer
  • Complete the sentence.
    10·1 answer
  • A co-worker is called away for a short errand and leave the clinical PC logged onto the Confidential Information System. You nee
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!