about | help | code help+videos | done | prefs |
Write a method that either returns the sum of 'a' and 'b' or their product. Return their sum if 'sum' is true, otherwise return the product of a and b. The values of 'a' and 'b' can be any valid integer values. Look at the test data for examples. test2023_10_05_APP1SLHL_prodOrSum(5, 2, true) → 7 test2023_10_05_APP1SLHL_prodOrSum(-190, 180, true) → -10 test2023_10_05_APP1SLHL_prodOrSum(5, 2, false) → 10 ...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