I have no idea of this programe. // FloorCeil.java public class FloorCeil { // R
ID: 3539764 • Letter: I
Question
I have no idea of this programe.
// FloorCeil.java
public class FloorCeil
{
// Return the index of the largest item not larger than o.
public static int floor(Comparable [] l, Object o)
{
// TBD
}
// Return the index of the smallest item not smaller than o.
public static int ceil(Comparable[] l, Object o)
{
// TBD
}
// Test driver.
public static void main(String[] args)
{
Double[] l = new Double[100];
for (int i = 0; i < l.length; i++) {
l[i] = new Double(i);
}
System.out.println("Should print 20.0 : " +
l[floor(l, new Double(20.7))]);
System.out.println("Should print 71.0 : " +
l[ceil(l, new Double(70.8))]);
}
}