Can someone please help me with this program? it is supposed to ask user to input ten integers which are part of an array and then output that array and then output the numbers in ascending and descending order in an array. can you repair this program? thanks.
import java.io.*;
public class Elements
{
static BufferedReader keyboard =
new BufferedReader(new InputStreamReader(System.in));
public static void main (String[] args) throws IOException
{
int[] input = new int[10];
System.out.println("Enter ten numbers each on a different line: ");
for(int i = 0; i < 10; i++)
{
input = Integer.parseInt(keyboard.readLine());
}
System.out.print("Your numbers are: ");
for (int i = 0; i < 9; i++)
{
System.out.print(input + ", ");
}
System.out.println(input[9] + ".");
int sort;
int unsort;
int Largest = -1;
int i;
for(sort = 0; sort < 10; sort++)
{
for(unsort = 0; unsort < 10; unsort++)
{
if(input[unsort] > Largest)
{
Largest = input[unsort];
i = unsort;
}
}
int[] NewAry = new int[10];
i = 0;
NewAry[sort] = Largest;
input = -1;
Largest = -1;
}
System.out.println("Your numbers in descending order are: " + NewAry[sort]);
}
}