CS代写 ICT373: Lab Session THREE

ICT373: Lab Session THREE
(All questions are important)
(Practice on interfaces, collections and exceptions)
1. Write a java specification for an interface ¡°Orderer¡± which has one method called isLOE (¡°is less than or equal to¡±) which takes two objects and returns a boolean indicating whether the first should be ordered before (or equal to) the second.

Copyright By PowCoder代写 加微信 powcoder

2. Write java code for (a class with) a static method ¡°minOf¡± which is given an ArrayList and an Orderer. The method should return the least Object in the collection according to the Orderer (i.e. find an Object in the collection which is less than or equal to all the others). You may assume that the Orderer is transitive, i.e. that if a<=b and b<=c then a<=c. 3. In a test program use minOf to find the alphabetically first in a list of Strings. 4. Use minOf to find the smallest in a list of Integers. 5. Use minOf on a list of pairs of ints where (a,b)<=(c,d) means aCS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com