/** * QUESTION 4: LinkedLists (5 marks) * * @param max : add all numbers below the double max * @ret
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
/** * QUESTION 4: LinkedLists (5 marks) * * @param max : add all numbers below the double max * @ret
/** * 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 }