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
zmey [24]
4 years ago
13

Write a function that, given an array of integers and its size, reverses the elements in the array. For example, if the original

array was [10, 15, 5, 25, 0] the new array should be [0, 25, 5, 15, 10].
Computers and Technology
1 answer:
Mrac [35]4 years ago
8 0

Answer:

import java.util.Arrays;

public class num11 {

   public static void main(String[] args)

   {

       int [] originalArray = {10, 15, 5, 25, 0};

       System.out.println("Original Arrays is: "+Arrays.toString(originalArray));

       reverseArray(originalArray, originalArray.length);

   }

//Method reverseArray

  public static void reverseArray(int a[], int n)

   {

       int[] newArray = new int[n];

       int m = n;

       for (int i = 0; i < n; i++) {

           newArray[m - 1] = a[i];

           m--;

       }

      #Printing the Reverse

       System.out.println("The Reversed Array is "+Arrays.toString(newArray));

   }

}

Explanation:

Using Java programming language:

The method is created to accept two parameters (an array and its size)

Create a new array within the method int[] newArray = new int[n];

Using a for loop iterate over the original array and place each of its elements in the new array from the last index, this places the elements reversively.

Use Java's toString() to display the revesered Array

You might be interested in
Please help
guapka [62]

From: Tom Pearson, Manager, District Five

Regarding: New Incoming Manager, Geraldine Hines

Dear Comstock Staff: Beginning March 15, 2018, you will have a new District Five Regional Manager. After 35 years of continuous service, I am leaving all of you to pursue an exciting future.

It has been my pleasure to train my successor, Geraldine Hines, this past year. Geraldine has demonstrated that she shares the company vision to be the employer of choice here in the Valley of the Sun. I am confident that she will lead all of you into the stratosphere as we merge our call centers and expand our donor site availability.

Please give Geraldine the same level of excellence you have given to me, to our staff and to our donors.

Sincerely.

Tom Pearson, Outgoing Manager, District Five

3 0
3 years ago
Thad found a website for his research about the U.S. Constitution. Which of the following is a clue that the source may not be r
vazorg [7]
<span>D. The information comes from the Library of Congress since its a official page </span>
8 0
3 years ago
Read 2 more answers
Nick is a food blogger. He first writes his draft on an electronic document, checks and corrects mistakes, and pastes the conten
nasty-shy [4]

The answer is B: Spelling and Grammar

Nick knows that it is important to check for spelling and grammar mistakes before distributing his content. Fortunately, Microsoft Word makes it easier to spell check his work all at once by running the spelling and grammar checker. To do this on his Word document, he is required to click the Review tab and then click the Spelling or Spelling & Grammar button. If Word finds any mistakes, a dialog box will pop up with an option to correct.

3 0
3 years ago
Read 2 more answers
What is the smallest v groove angle that can be welded useing the fca welding process?
vagabundo [1.1K]
The smallest v groove angle that can be welded using the FCA welding process is 20 degrees. Double v joints help for buckling forces especially in welding thicker metals.
3 0
3 years ago
Sarah is a busy real estate agent with a growing clientele. She is looking to purchase a new computer and software so that she c
Lina20 [59]

Answer:

USB flash drive is the storage device that is used by Sarah.

Explanation:

A USB flash drive is the device in which the data is stored, it is the portable storage device which is used to store important data and files and it is also used for data backup, run a diagnostics to troubleshoot the computer problems or also for launch the OS(operating system) from the bootable USB.

The first USB flash drive came in the market in the year 2000 with the 8 MB(megabytes) of the storage capacity.

7 0
4 years ago
Other questions:
  • What is the highest education degree available at a community college
    14·1 answer
  • Which answer best describes an unsubsidized federal loan?
    7·1 answer
  • If a computer file will not open, what should you do? A. Make sure you have the correct software to open it. B. Change the name
    9·1 answer
  • FOR PYTHON 3
    10·1 answer
  • You are late in the preparation of the computer graphics for your final report and presentation. You run into a friend who is gr
    13·1 answer
  • Explain what a lookup table is (assembly). Write pseudo code
    13·1 answer
  • Will technology be the destruction or salvation of human-kind
    13·2 answers
  • Madeleine's Instructor praised her for capturing a nearly perfect image. It included dominance, harmony, and proportion among ot
    13·1 answer
  • What is the general term for programs used to operate a computer
    15·1 answer
  • What will happen if storage devices are removed from computer?​
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!