public class SimpsonsParadox{ public static boolean isSimpsonExample(int p1y1S, int p1y1T, int p2y1S, int p2y1T, int p1y2S, int p1y2T, int p2y2S, int p2y2T){ if (((p1y1S + p1y2S)/(p1y1T + p1y2T) > ((p2y1S + p2y2S)/(p2y1T + p2y2T))) && ((p1y1S/p1y1T) < (p2y1S/p2y1T)) && ((p1y2S/p1y2T) < (p2y2S/p2y2T)))){ return true; } else if ((((p1y1S + p1y2S)/(p1y1T + p1y2T) < ((p2y1S + p2y2S)/(p2y1T+p2y2T)))) && ((p1y1S/p1y1T) > (p2y1S/p2y1T)) && ((p1y2S/p1y2T) > (p2y2S/p2y2T))){ return true; } else return false; } } public static void main(String[] args) { }
when i run this code with a test code it seems to automatically skip both my if statements and go straight to my else and return false. I tested this also by simply making one if statement be if (p1y1S>1) return true and this is the case for several different tests within my test code so i can't figure out why it is skipping my if statements. any help appreciated
thanks