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

 

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

Spring Break is a time when it seems that everything is on break and many things are backwards of what they normally are. For that reason, we will write a method that takes an integer as an input parameter, then outputs a string with the integer's digits in reverse order with a "-" inserted as a break between each digit. Look at the test data for examples. Note that the integer parameter will be positive, but could be a single digit.


SpringBreakInTheNumber(13245) → "5-4-2-3-1"
SpringBreakInTheNumber(13214) → "4-1-2-3-1"
SpringBreakInTheNumber(5) → "5"

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

public String SpringBreakInTheNumber(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