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

 

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

Write a RECURSIVE method that returns the "crazy product" of the digits of the parameter 'wholeNum' with each digit offset by 'offset' amount. For example, the "crazy product" found using wholeNum=132 and offset=2 would be 60 because (1+2)*(3+2)*(2+2)=3*5*4=60. So each digit of 132 is increased by 2 and then multiplied together. Your solution must be completely recursive with no loops. The parameter 'wholeNum' will be greater than zero. The parameter 'offset' will be between 0 and 9.


feb26_2016_APSLHL_crazyMultDigits(640085, 0) → 0
feb26_2016_APSLHL_crazyMultDigits(640085, 1) → 1890
feb26_2016_APSLHL_crazyMultDigits(22222222, 0) → 256

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

public int feb26_2016_APSLHL_crazyMultDigits(int wholeNum, int offset) { }

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: 330

Copyright Nick Parlante 2017 - privacy