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

 

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

Write a method that returns an array of ten digits made up of the digits of 'num' as shown in the test data. Note the leading zeros if 'num' has less than ten digits. As preconditions you may assume that 'num' is non-negative and has at most ten digits. Look at the test data for examples. You may not use any libraries or wrapper classes!


test2021_12_15_SLHL_digitArray(1247815) → [0, 0, 0, 1, 2, 4, 7, 8, 1, 5]
test2021_12_15_SLHL_digitArray(538927) → [0, 0, 0, 0, 5, 3, 8, 9, 2, 7]
test2021_12_15_SLHL_digitArray(90278) → [0, 0, 0, 0, 0, 9, 0, 2, 7, 8]

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

public int[] test2021_12_15_SLHL_digitArray(int num) { }

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

Copyright Nick Parlante 2017 - privacy