Question: { public static void main ( String [ ] args ) { Scanner input = new Scanner ( System.in ) ; System.out.print ( Enter

{
public static void main(String[] args)
{
Scanner input = new Scanner(
System.in);
System.out.print("Enter an integer... ");
int n1= input.nextInt();
System.out.print("And another... ");
int n2= input.nextInt();
System.out.print("And just one more... ");
int n3= input.nextInt();
int min = n1, max = n1;
if (n2> max) max = n2;
if (n3> max) max = n3;
if (n2 max) min = n2;
if (n3 max) min = n2;
int middle =(n1+ n2+ n3)-(min + max);
System.out.println("Ascending: "+ min +""+ middle +""+ max)
System.out.println("Descending: "+ max +""+ middle +""+ min
}
}Task 03: The DebugFive2 program accepts user input and
displays the correct output.
I am confused on how to get the integers sorted corrected. Can I get some help?
 { public static void main(String[] args) { Scanner input = new

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!