Advertisement
Guest User

Untitled

a guest
Oct 21st, 2014
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1.  
  2. public class Main {
  3. public static void main(String [] args){
  4. //Test Case 1
  5. checkAppts(10,10,11,11);
  6. //Test Case 2
  7. checkAppts(10,12,15,17);
  8. //Test Case 3
  9. checkAppts(13,10,14,14);
  10. }
  11. private static void checkAppts(int start1, int start2, int end1, int end2){
  12. int start;
  13. int end;
  14. if(start1 > start2)
  15. start = start1;
  16. else
  17. start = start2;
  18. if(end1 < end2)
  19. end = end1;
  20. else
  21. end = end2;
  22. if(start < end)
  23. System.out.println("Appts overlap");
  24. else
  25. System.out.println("Appts Dont Overlap");
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement