00:01
In this video, we will write a program that prompts the user to enter three integers and displays the integers in non -decreasing order, kind of a roundabout wave, saying ascending.
00:10
I've already created our class as well as the main method within it.
00:13
I've also imported java .utel .scanner, since we know we'll be taking user input.
00:18
The first thing we can do is go ahead in the main method and create a new scanner object named input by calling a scanner with the argument.
00:31
System .in, which allows keyboard input to be read by our java application.
00:38
The next thing we're going to want to do is use system.
00:41
.out .print l .n to prompt the user to please enter three integers.
00:54
After this, we'll want to store all three as, i guess, number one equals input.
01:01
That nextn, which is saving the next token inputted as an integer.
01:09
We can just copy and paste this line because we'll be saving next as n2 and the last is n3.
01:23
Now we've saved all of our integers that the user is inputted.
01:30
So now, an easy way to sort these three integers.
01:36
Since we only have three, it would be to take the minimum of n2 and n3, and then the minimum of that result, and n1.
01:46
This will give us the min value of all three integers...