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

 

numberLine


Return a string that starts with "Number Line:" followed by the numbers starting with a up to but not including b with a dash(-) between each number. If the number line includes negative numbers, put the number inside parenthesis.


numberLine(1, 10) → "Number Line:1-2-3-4-5-6-7-8-9"
numberLine(-3, 3) → "Number Line:(-3)-(-2)-(-1)-0-1-2"
numberLine(10, 15) → "Number Line:10-11-12-13-14"

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

public String numberLine(int a, int b) { }

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: 150 Post-solution available

Copyright Nick Parlante 2017 - privacy