Page 1 of 1

/** * QUESTION 4: LinkedLists (5 marks) * * @param max : add all numbers below the double max * @ret

Posted: Fri Jul 01, 2022 5:51 am
by answerhappygod
/** * QUESTION 4: LinkedLists (5 marks) * * @param max : add all numbers below the doublemax * @return the sum of all double's in the listwhich are smaller than max. * return 0 if thelist is empty. * * Example: * * If head - >2.8 -> -8.6 -> -1.6 -> 1.5 -> 5.5 -> null * * ThensumLessThan(2) should return -9, * * sumLessThan(-2.4)should return -12.4. * * sumLessThan(-2000) should return 0. * */ public double sumLessThan(double max) { // To be completed }