String Bin(arithmetic_expression, string1, ,..., stringN, sentinelN, default_string)
if (arithmetic_expression<=sentinel1) return string1; ...... else if (arithmetic_expression<=sentinelN) return stringN; else return default_string;
69707172737475767778798081828384858687888990
t3.set(4, new Double(1.80)); t3.set(5, "L"); t3.set(6, new Double(1.90)); t4.set(7, "XL"); Bin func = new Bin(); String r = func.exec(t1); assertTrue(r.equals("young")); r = func.exec(t2); assertTrue(r.equals("M")); r = func.exec(t3); assertTrue(r==null); try { r = func.exec(t4); fail("Exception not triggered"); } catch (IOException e) { assertTrue(e.getMessage().equals("Bin : Encounter null in the input")); } }