Question: 1. Write a function in Scheme that accepts 3 parameters and counts the number of values in a specified range (low to high) which

1. Write a function in Scheme that accepts 3 parameters and counts the number of values in a specified range

1. Write a function in Scheme that accepts 3 parameters and counts the number of values in a specified range (low to high) which are divisible by a third parameter. Example: (count 1 12 3) would resolve to 4 because there are 4 values from 1 to 12 which are dividable by 3. o 2. Write a function in Scheme that counts the number of values in a list that are divisible by 2. o Example: (count' (1 2 3 4 5 6 7 8 9 10 11 12) 3) would resolve to 4 because there are 4 values in the list which are dividable by 3. 3. Rewrite each of the above so that they accept a "Predicate function" which can be used to determine whether an item should be counted or not. o Example: (count 1 12 (lambda (a) (= (modulo a 2) 0)) would resolve to 4

Step by Step Solution

3.48 Rating (148 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To tackle these tasks well be writing Scheme functions that respectively count the number of values within a specified range or list that are divisibl... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!