about | help | code help+videos | done | prefs |
Write a method that returns the sum of all the integer values in 'nums' that have values between 'low' and 'high' inclusive. For example, if 'nums' is {5,12,3,17,22,9,15}, 'low' is 15, and 'high' is 20, you would return 32 since only 15 and 17 are between 'low' and 'high' inclusive. As preconditions you may assume that low<=high. Look at the test data for additional examples. test2024_12_12_APP1SLHL_addBetween([352], 300, 400) → 352 test2024_12_12_APP1SLHL_addBetween([5, 12, 3, 17, 22, 9, 15], 15, 20) → 32 test2024_12_12_APP1SLHL_addBetween([-325, -23, 235, -35, -3526, -9182, -5, 2414, 325, 977, 0], -8000, -8) → -3909 ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 270
Copyright Nick Parlante 2017 - privacy