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

 

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

Write a method that accepts two numbers, 'num' and 'ofst'. Return the product of all the digits in 'num' but with each digit offset by 'ofst' amount. For example, if you pass in 523,-1 the result would be 8 because 4*1*2=8. So each digit is offset by -1 making the 5 a 4, the 2 a 1, and the 3 a 2, then the product of all those values is found. This CAN be done nicely with recursion, but recursion is NOT required.


may12_2017_APSLHL_digProdOffSet(5, 0) → 5
may12_2017_APSLHL_digProdOffSet(5, 2) → 7
may12_2017_APSLHL_digProdOffSet(3, 9) → 12

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

public int may12_2017_APSLHL_digProdOffSet(int num, int ofst) { }

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

Copyright Nick Parlante 2017 - privacy