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

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
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

Post 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 }
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply