Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

{ 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?
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

MySQL Crash Course A Hands On Introduction To Database Development

Authors: Rick Silva

1st Edition

1718503008, 978-1718503007

More Books

Students also viewed these Databases questions