can someone help me with my code? I just want it to have user enter numbers, the
ID: 3654026 • Letter: C
Question
can someone help me with my code? I just want it to have user enter numbers, then print out smallest to largest. import java.util.Scanner; public class Examinenumbers { public static void main(String[] args) { int min = value; int max = value; Scanner console = new Scanner (System.in); System.out.print(" How many numbers do you have?"); int totalnumber = console.nextInt(); double sum = 0.0; for( int i = 1; i <= totalnumber; i++ ) { System.out.print(" #" + i + " ? "); double next = console.nextDouble(); sum+= next; } for( int i =1; i<= length -1; i++) { if ( value % 2 == 0) { value = value /2; } else { value = 3*value + 1; } if(value> max) { max = value; } else if ( value < min) { min = value; } } System.out.println( " max" + max); System.out.print ( " min " + min); } }Explanation / Answer
import java.util.Scanner; public class Examinenumbers { public static void main(String[] args) { double min = 0; double max = 0; Scanner console = new Scanner (System.in); System.out.print(" How many numbers do you have?"); int totalnumber = console.nextInt(); for( int i = 1; iRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.