logo CodeStepByStep logo

CountInRange

Language/Type: C# List collections
Related Links:
Author: Eric Roberts (on 2019/07/08)

Write a method named CountInRange that accepts three parameters: a List of integers, a minimum and maximum integer, and returns the number of elements in the list within that range inclusive. For example, if the list v contains {28, 1, 17, 4, 41, 9, 59, 8, 31, 30, 25}, the call of CountInRange(v, 10, 30) should return 4. If the list is empty, return 0. Do not modify the list that is passed in.

Method: Write a C# method as described, not a complete program or class.

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.