about | help | code help+videos | done | prefs |
test2022_09_12_P1SLHL_addPosOnly
Write a method that returns the sum of the three integer parameters, but only include numbers in the sum if they are positive. For example, with parameters 6, -2, and 1, you would return 7 because that is the sum of 6+1. You did not include the -2 in the sum because it was not positive. Look at the test data for further examples. test2022_09_12_P1SLHL_addPosOnly(352, 23, 325) → 700 test2022_09_12_P1SLHL_addPosOnly(-124, 5334, 214) → 5548 test2022_09_12_P1SLHL_addPosOnly(1, 2, 3) → 6 ...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: 200
Copyright Nick Parlante 2017 - privacy