about | help | code help+videos | done | prefs |
Write a method that returns the sum of 'a', 'b', and 'c', but only include each value if the related boolean variable is 'true'. For example, only include 'a' in the sum if 'incA' is 'true'. In all of the boolean variables are 'false' return zero. Look at the test data for examples. quiz2023_09_26_APP1SLHL_includeOrNot(-100, true, 20, true, 5000, false) → -80 quiz2023_09_26_APP1SLHL_includeOrNot(0, true, 0, true, 0, true) → 0 quiz2023_09_26_APP1SLHL_includeOrNot(-1, true, -10, true, -100, true) → -111 ...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