about | help | code help+videos | done | prefs |
Write a method that returns the "funny sum" of two integer parameters. The "funny sum" is just the sum of the two integers if the first integer is even. However, if the first integer is odd, the "funny sum" is actually the product of the two numbers. Note that it does not matter if the second number is even or odd, on the first number. As a precondition, you may assume that both numbers will be positive. dec1_2017_APSLHL_funnySum(5, 7) → 35 dec1_2017_APSLHL_funnySum(6, 12) → 18 dec1_2017_APSLHL_funnySum(2, 7) → 9 ...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: 250
Copyright Nick Parlante 2017 - privacy