public class FourNbrSort { public static void main (String[] args) { String s = javax.swing.JOptionPane.showInputDialog("Enter Four Numbers: "); int i = s.indexOf(" "); int j = s.indexOf(","); String an = s.substring(i+1,j); double w = Double.parseDouble(an.trim()); int k = s.indexOf(",", j+1); String bn = s.substring(j+1,k); double x = Double.parseDouble(bn.trim()); int l = s.indexOf(",", k+1); String cn = s.substring(k+1,l); double y = Double.parseDouble(cn.trim()); int m = s.indexOf(",", l+1); String dn = s.substring(l+1); double z = Double.parseDouble(dn.trim()); if (w>x) { int temp; w = temp; w = x; x = temp; } if (w>y) { int temp2; w = temp2; w = y; y = temp2; } if (w>z) { int temp3; w = temp3; w = z; z = temp3; } javax.swing.JOptionPane.showMessageDialog(null,"Input list : "+s+"\n"+ "Ordered list : " +);
i need to order these numbers using the IF-else statement and once i have that setup i really dont know how to show the output of the ordered list. Ignore the "Ordered list : " +) part of the code
if anyone could help me it would be great