Code using Java.:
Create CHECKING FUNCTIONS.
boolean isGreaterThan(int[] m1, int[] m2); // Returns True if m1
> m2.
boolean isEqual(int[] m1, int[] m2); // Returns True if m1 ==
m2.
// Returns True if m1 > m2. boolean isGreaterThan(int[] m1, int[] m2){ if(m1==m2) { for (int i = 0; i < m1.length; i++) { if(m1[i] <= m2[i]){ return false; } } return true; } else{ return false; } } // Returns True if m1 == m2. boolean isEqual(int[] m1, int[] m2){ if(m1==m2) { for (int i = 0; i < m1.length; i++) { if(m1[i] != m2[i]){ return false; } } return true; } else{ return false; } }
Get Answers For Free
Most questions answered within 1 hours.