about | help | code help+videos | done | prefs |
Write a method that returns the sum of 'a' and 'b' if 'add' is true. Otherwise, return the result of subtracting 'b' from 'a'. Look at the test data for examples. test2021_10_07_APSLHL_addOrSub(5, 7, true) → 12 test2021_10_07_APSLHL_addOrSub(5, 7, false) → -2 test2021_10_07_APSLHL_addOrSub(8, 100, true) → 108 ...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: 205
Copyright Nick Parlante 2017 - privacy