Can someone help me come up with a formula for calculating the difference in time?
The solution I originally provided here is wrong, the comments on why the question itself is out of scope are interesting though. 


      int hours = Math.abs(a - b)/ 100;

    int minutes1 = Math.min(a,b) % 100; 
    int minutes2 = Math.max(a,b) % 100; 

    int mdifference = ((Math.min(a,b) / 100) == (Math.max(a,b) / 100)) ? minutes2 - minutes1 : (60 - minutes1) + minutes2;


    System.out.print("\nDifference: " + hours + " hours and " + mdifference + " minutes");