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_toNum
prev  |  next  |  chance

Write a RECURSIVE method that accepts an array of non-negative single-digit integers, and then returns a double that represents those digits as a double parameter. For example, a call the this method that passes in [3,8,0,0,5] would return the double 38005.0. The integer array 'digits' will have at least one integer and each integer will be a 0, 1, 2, 3, 4, 5, 6, 7, 8, or 9. If there are leading zeros such as [0,0,0,5,3], the return value does not include those zeros, so in this case a 53.0 would be returned. Notice that the '.0' at the end is because the return type is a double.


may12_2017_APSLHL_toNum([3]) → 3.0
may12_2017_APSLHL_toNum([5, 4, 2, 7, 0, 0, 2]) → 5427002.0
may12_2017_APSLHL_toNum([3, 0, 0, 5, 2, 1]) → 300521.0

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

public double may12_2017_APSLHL_toNum(int[] digits) { }

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

Copyright Nick Parlante 2017 - privacy