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

 

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

Write a method that accepts a positive integer less than 10000 called 'num' and a single positive digit called 'digit'. Return a number with the digits in 'num' in reverse order with 'digit' inserted between each digit in 'num'. Look at the test data for examples. NO STRING methods or any other form of string usage is allowed. NO ARRAYS or ARRAY LISTS are allowed either! You have to solve this one using div and mod.


jan11_2016_HLinterlaceDigits(5, 1) → 51
jan11_2016_HLinterlaceDigits(23, 9) → 3929
jan11_2016_HLinterlaceDigits(124, 0) → 402010

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

public int jan11_2016_HLinterlaceDigits(int num, int digit) { }

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