import java.util.Scanner;
public class Sort{
public static void main(String[] args) {
String userInputStr;
int numofNum;
Scanner inputStream = new Scanner(System.in);
System.out.print("how many values would you like to input?");
userInputStr = inputStream.nextLine();
numofNum = Integer.parseInt(userInputStr);
double[] arr = new double [numofNum]; //creates array with doubles, numofNum number of values in the array
for (int i=0; i<numofNum; i++) //gets info from user for each spot in array
{
System.out.print("\nenter value: ");
userInputStr = inputStream.nextLine();
arr[i] = Double.parseDouble(userInputStr);
System.out.print(arr[i]);
}
Arrays.sort(arr); //sort array
System.out.println("\n\nSorted Numbers: ");
for (int i=0; i<numofNum; i++) //prints each spot in array
{
System.out.print(arr[i]+ ", ");
}
}
}
Sort.main(null);