Hi guys,

I am new to java, I am having trouble on outputting the num2 on the screen. I could not see any errors indicated the problem on the program(Eclipse). However, the program just miss scan the num2. I was trying to sort the number and output them from smallest to largest.

Any suggestion would be helpful and appreciated!

----------------------------------Code

import java.util.Scanner;

public class Demo{

public static void main(String[] args){

System.out.println("Please input three songs' BPMs");

int S,M,L;

Scanner keyboard =new Scanner(System.in);

int num1 = keyboard.nextInt();

int num2 = keyboard.nextInt();

int num3 = keyboard.nextInt();

boolean isAllSame = (num1 == num2) && (num2 == num3) && (num1 == num3);

boolean isDI = (num1 != num2) && (num2 != num3) && (num1 != num3);

boolean isTS = (num1 != (num2 = num3)) || ((num1=num2) !=num3) || ((num1 = num3) != num2);

boolean isCMatch = Math.abs(num2 - num3) < 10 && Math.abs(num2 - num1) < 10;

boolean isCM2 = Math.abs(num3 - num1) < 10 && Math.abs(num3-num2) <10;

boolean isCM3 = Math.abs(num1 - num2) < 10 && Math.abs(num1-num3) <10;

boolean isOkMatch = Math.abs(num2 - num3) >=10 && Math.abs(num2 - num3)<=30;

boolean isOM2 = Math.abs(num3 - num1) >=10 && Math.abs(num3 - num1)<=30;

boolean isOM3 = Math.abs(num1 - num2) >=10 && Math.abs(num1 - num2)<=30;

boolean isMismatch = Math.abs(num2 - num3) >=31;

boolean isMM2 = Math.abs(num3 - num1) >=31;

boolean isMM3 = Math.abs(num1 - num2) >=31;

//small to largest

if (num1<num2 && num1<num3 && num2<num3){

S = num1;

M =num2;

L =num3;}

else if (num2<num1 &&num2<num3&&num1<num3){

S = num2;

M = num1;

L = num3;}

else if (num3<num1 &&num3<num2 && num1<num2){

S =num3;

M =num1;

L =num2;}

else{

S = num2;

M = num3;

L = num1;

System.out.println("Sorted BPMs are: "+S +","+M +","+ L);

}

if (isAllSame)

System.out.println("Three songs have same BPMs.");

else if (isDI && isCMatch){

N(); CM(); }

else if (isDI && isCM3){

N(); CM(); }

else if (isDI && isCM2){

N(); CM(); }

else if (isTS && isCMatch){

SBMP(); CM(); }

else if (isTS && isCM2){

SBMP(); CM(); }

else if (isTS && isCM3){

SBMP(); CM(); }

//When two song BPM larger than 10. order from all different to two same.

else if (isDI && isOkMatch){

N(); OK(); }

else if (isDI && isOM3){

N(); OK(); }

else if (isDI && isOM2){

N(); OK(); }

else if (isTS && isOM2){

SBMP(); OK();}

else if (isTS && isOM3){

SBMP(); OK();}

else if (isTS && isOkMatch){

SBMP(); OK();}

//When some BPMs are larger than 30, Order from all different to some are same.

else if (isDI && isMismatch){

N(); PM(); }

else if (isDI && isMM3){

N(); PM(); }

else if (isDI && isMM2){

N(); PM(); }

else if ( isTS && isMM2){

SBMP(); PM();}

else if ( isTS && isMismatch){

SBMP(); PM();}

else if ( isTS && isMM3){

SBMP(); PM();}

}

public static void SBMP(){

System.out.println("\nSome are the same BMP");

}

public static void N(){

System.out.println("\nNone share the same BMP");

}

public static void CM(){

System.out.println("All are within 10 BPMs of eath other");}

public static void OK(){

System.out.println("All are within 10 to 30 BPMs of each other.");}

public static void PM(){

System.out.println("At least two songs are Possible Match");}

}

------------------------------------Output

Please input three songs' BPMs

15

19

50

Sorted BPMs are: 50,50,15

None share the same BMP

At least two songs are Possible Match