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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!