Question: scheme function: cappedSum - takes as input an integer C, and a list L of integers. The input integer C is called the cap. The
scheme function: "cappedSum" - takes as input an integer C, and a list L of integers. The input integer C is called the "cap". The output is the integer sum of each integer in L, "capping" each number at a maximum value of C. For example, (cappedSum 7 '(6 4 9 2 8)) should return 26, because 6 + 4 + 7 + 2 + 7 = 26 (note that the 9 and 8 are both greater than 7, and so they have been replaced with 7).
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
