about | help | code help+videos | done | prefs |
Write a method that returns either the sum of a and b, or their product, depending on if 'add' is true or not. If 'add' is true, return the sum of a and b. If 'add' is false, return the product of a and b. Look at the test data for examples. quiz2021_10_12_APSLHL_addOrMult(23, 2, true) → 25 quiz2021_10_12_APSLHL_addOrMult(11, 1, false) → 11 quiz2021_10_12_APSLHL_addOrMult(11, 11, false) → 121 ...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: 210
Copyright Nick Parlante 2017 - privacy