Question: Write a program that reads in three double numbers and prints the three inputs in sorted order. For example: Please enter three numbers: 4 9
Write a program that reads in three double numbers and prints the three inputs in sorted order. For example: Please enter three numbers: 4 9 2.5 The inputs in sorted order are: 2.5 4 9 You must use two scanners. The first one to accept all three numbers, and a second to parse them to three variables. Scanner keyboard = new Scanner(System.in); System.out.println("Please enter three numbers separated by spaces."); String answer = keyboard.nextLine(); Scanner parser = new Scanner(answer); double num1 = parser.nextDouble(); etc...
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
