What I need to do is in the comments before the method. A holds a 10 element long array the user inputs:
//Reverses the contents of the array. The array remains unchanged
//It prints the reversed array to the screen
static void reverseArray(int [] A)
{
int[] tempArray = new int[10];
for(int i = A.length-1; i >= 0; i--)
{
//Supposed to copy what's in reversed array A to tempArray
tempArray[i] = A[i];
}
printArray(tempArray); //Prints the updated array to the screen
}
What I wanted it to do was count backward from the last element of A to the first and then copy that to tempArray. But now it just prints the array the user inputted. I know that I need 2 integers to keep track of what's increasing and decreasing but I don't know how to implement them.