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
Jlenok [28]
3 years ago
9

What would be the results of the following code? final int SIZE = 25; int[] array1 = new int[SIZE]; … // Code that will put valu

es in array1 int value = 0; for (int a = 0; a < array1.length; a++) { value += array1[a]; }
Computers and Technology
1 answer:
xz_007 [3.2K]3 years ago
7 0
The code is first declaring array1 as a new array of integers with length 25. Then the comment tells us that somewhere in the middle of the code, values are given to each element of array1.

Lastly, we are iterating through the array using a for loop. We start at index 0, and continue until the index value (a) is one less than the length of the array. So array1[a] will give us the value that was assigned to the element at index a.

In the for loop, we are adding the value of array[a] to the integer "value" which was initialized as 0. Therefore, the result will be the sum of all the integers in array1.
You might be interested in
What is the decimal equivalent of (11000 + 10000)/101?
Arturiano [62]

its answer in binary is 1000 and in decimal is 8.

7 0
3 years ago
When writing test methods, what functionality is verified by the system method "runAs()"?
olchik [2.2K]

Answer:

The main functionality verified by this test method command is user sharing record.

Explanation:

Generally, every apex code runs in system mode.

Apex is strong object-oriented programming language that allows the developers to execute flow and transaction control.

Using syntax which look like java and acts as databases, Apex allows the developer to add any type of business logics to an event which can include button, clicks records or visual pages.

Apex code can be initiated by web service request.  

The permissions and record sharing of current user are not consider by apex codes.

Now the system method runAs() will allow you to take or write a test method which will basically change the user context to an existing or an new user, so that the record sharing will take place.

runAs() command will not change or anything done with user permissions or permission levels, it will only record sharing of the user.  

When you use runAs() command the original and true context will run after the test method is once completed under the command of runAs().

The runAs() has no concern with the user license.  

If there is no or expired your personal or organization license you can just make a new user with this runAS() command.

In using this command we have to make a private class by the name of this test and then our further code to make a user , afterwards  which we will the true and original code of ours which we want to run.

There are many other uses of runAs() like  

 Mixed DML operations in test by opening the DML operations.

 We can also use it as a version which will take a package as a version argument. This will cause the code a specific version.

runAs(System.Version) is the command used for this.

4 0
3 years ago
Write a program that takes in a line of text as input, and outputs that line of text in reverse. The program repeats, ending whe
Nana76 [90]

<u>Answer:</u>

<em>using System; </em>

<em>public class Program </em>

<em>{ </em>

<em> public static void Main() </em>

<em> { </em>

<em> String input ; </em>

<em> while(true) </em>

<em> { </em>

<em>  input = Console.ReadLine(); </em>

<em>  if(input.Equals(""quit"")) </em>

<em>  break; </em>

<em>  Reverse_String(input); </em>

<em> } </em>

<em> return; </em>

<em> } </em>

<em>static void Reverse_String(string input_text) </em>

<em>{ </em>

<em>    char[] text = input_text.ToCharArray(); </em>

<em>    Array.Reverse(text); </em>

<em>    Console.WriteLine(text); </em>

<em>} </em>

<u>Explanation:</u>

<em>In the above program a separate function is written to reverse the string.</em>

This method takes the string as an argument and place it in a array and then use the built-in function reverse and print the reversed string in the console.

<em>In the main(), the input is obtained from the console and it is passed to the reversestring(). </em>

7 0
3 years ago
Read 2 more answers
Need help ASAP <br><br> Thankss + BRAINLIST only for correct answers
AVprozaik [17]
Why visit it?
For entertainment, purely for the user to enjoy the content that has been produced for them.

Why was it made?
Netflix is a subscription based service that has been made to allow users to stream TV shows and other entertainment sources. It was made for leisure.
7 0
2 years ago
So this is what i use to code and all of that
givi [52]

Answer: yeah!

Explanation:

Have a good day!

5 0
2 years ago
Other questions:
  • After a robbery, what is the purpose of conducting a neighborhood canvass?
    9·1 answer
  • What is Processor to Memory Mismatch problem?
    15·1 answer
  • What does the CPU do in a computer?
    7·2 answers
  • Que es un programa de ordenador?
    10·1 answer
  • With a DUI charge on a driver’s record ______________.
    10·1 answer
  • Communication protocols, sets of rules agreed to by all parties, are designed in order to:
    15·1 answer
  • It is where your cpu (processor) is installed
    10·2 answers
  • Write a definition in your own words for intranet. Please don't copy and paste.
    7·2 answers
  • A slide titled Alexander Graham Bell. There are 6 bulleted entries on the slide, and there is a lot of text on the slide. There
    11·2 answers
  • Which are the top 10 Popular Cars and Video Games get max ammount of point that we can give​
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!