about | help | code help+videos | done | prefs |
Write a method that returns the sum of a, b, and c. The sum will always include c, but it will only include a if useA is true. The sum will only include b if useB is true. For example: strangeSum(2,6,10,true,false) will return 12 since 2+10=12. Notice that the 6 was not inluded in the sum because useB was false. strangeSum(15, 20, 100, true, true) → 135 strangeSum(15, 20, 100, true, false) → 115 strangeSum(15, 20, 100, false, false) → 100 ...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: 220
Copyright Nick Parlante 2017 - privacy