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

 

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

Write a method that returns a string made up of the digits of 'num' but with 'symbol' inserted between each digit and after the last digit. As preconditions you may assume that 'num' is positive and that 'symbol' is a non-empty string. Look at the test data! Don't forget about div and mod!


test2021_11_04_ALSLHL_spaceNum(8510, "><") → "8><5><1><0><"
test2021_11_04_ALSLHL_spaceNum(805040, "!") → "8!0!5!0!4!0!"
test2021_11_04_ALSLHL_spaceNum(781, ">>>>") → "7>>>>8>>>>1>>>>"

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

public String test2021_11_04_ALSLHL_spaceNum(int num, String symbol) { }

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