id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

jebbert@volusia.k12.fl.us > semiProduct
prev  |  next  |  chance

Let's define the "semiproduct" of two positive integers to be the product of the sums of each of their digits. So the "semiproduct" of 21 and 71 is 24 because 2+1=3 and 7+1=8, then 3*8=24. Decompose out a separate digitSum(int n) method that finds the sum of the digits of a positive integer.


semiProduct(18, 3) → 27
semiProduct(46, 73) → 100
semiProduct(12, 35) → 24

...Save, Compile, Run (ctrl-enter)

public int semiProduct(int a, int b) { }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Difficulty: 325 Post-solution available

Copyright Nick Parlante 2017 - privacy