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
goldenfox [79]
3 years ago
13

What is the problem, if any, with the following code?The desired output is [3,19].

Computers and Technology
1 answer:
vfiekz [6]3 years ago
8 0

Answer: You need a temporary variable to hold the value 3

Explanation:

So, aList[0] is 3 and aList[1] is 19, if it will be as it is you litteraly say to the compiler to change aList[0] to aList[1]  at this moment aList[0] is 19 and aList[1] also is 19 and if you try to change aList[1] to aList[0]  it will not change its value because they are the same.

You need temp variable to keep one of the values.

You might be interested in
What is software? Why is it needed? ​
sesenic [268]

Computer software, also known simply as software, also known by overseas Vietnamese as software is a collection of data or commands that instruct the computer to tell the computer how to work.  This is in contrast to the physical hardware, from which the system is built and actually does the work.  Because it helps people perform functions that humans can't do or do for a very long time

8 0
3 years ago
Describe the following software process models using your own words .Your explanation should also provide an example of a softwa
avanturin [10]

Answer:

Agile Development is a software methodology which is iterative.

Explanation:

Agile Development is a software methodology which is iterative.it is more useful to develop complex systems where regular touch up meetings/calls happen with the business to showcase their progress and ensure that the application is going in right direction. Compared to Waterfall ,where all phases are in sequence it is more recommended to design and develop complex software projects.

Agile Development is useful for complex software projects where we regularly in touch with the client and take our design and development decisions based on client feedback

Waterfall methodology is useful for simple projects where all the requirements are clear at the beginning and no more changes in requirement are required

6 0
4 years ago
The safest action to take if someone claiming to be from your banks calls you to ask for account information is to
aalyn [17]
<h2>Answer:</h2>

<u>The correct option is</u><u> (B) hang up and call back using the banks official phone number</u>

<h2>Explanation:</h2>

There are a lot of cases where people pretend to call from the banks where the receivers have the account. The caller tries to take the information from the receiver and pretends to be the bank official. If there is any doubt then the receiver should hang up the call and call back the official number of the bank to confirm that whether somebody has called from the bank to get the information.

8 0
3 years ago
Read 2 more answers
Which design principle indicates that a project is visually satisfying
joja [24]

Answer: harmony

Explanation:

Took the test on gmetrix ;)

6 0
3 years ago
Write a function addOddMinusEven that takes two integers indicating the starting point and the end point. Then calculate the sum
snow_lady [41]

Answer:g

   public static int addOddMinusEven(int start, int end){

       int odd =0;

       int even = 0;

       for(int i =start; i<end; i++){

           if(i%2==0){

               even = even+i;

           }

           else{

               odd = odd+i;

           }

       }

       return odd-even;

   }

}

Explanation:

Using Java programming language:

  • The method addOddMinusEven() is created to accept two parameters of ints start and end
  • Using a for loop statement we iterate from start to end but not including end
  • Using a modulos operator we check for even and odds
  • The method then returns odd-even
  • See below a complete method with a call to the method addOddMinusEven()

public class num13 {

   public static void main(String[] args) {

       int start = 2;

       int stop = 10;

       System.out.println(addOddMinusEven(start,stop));

   }

   public static int addOddMinusEven(int start, int end){

       int odd =0;

       int even = 0;

       for(int i =start; i<end; i++){

           if(i%2==0){

               even = even+i;

           }

           else{

               odd = odd+i;

           }

       }

       return odd-even;

   }

}

8 0
3 years ago
Other questions:
  • Which process improves the life of a computer?
    11·1 answer
  • Write a method that returns a new array by eliminating the duplicate values in the array using the following method header: Publ
    6·1 answer
  • I need help <br> Match each words with its definition!!!<br> Please helpppppppp
    12·1 answer
  • In 1–3 sentences, describe one reason you would import data into a database.
    15·2 answers
  • You need to synchronize your mobile device data with your desktop computer. for security reasons, your organization prohibits sy
    5·1 answer
  • Match each role to the corresponding web development task.
    14·1 answer
  • What is computer hardware?list any 4 computer hardware​
    12·2 answers
  • 9 Which of these words is used to begin a conditional statement? ​
    8·1 answer
  • 3. In 1989, the first handheld console was released by _____ and it was called ________.
    11·1 answer
  • Any task done by software can also be done using computer hardware, and any operation performed directly by hardware can be done
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!