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

 

orion.a.smith@gmail.com apcsa-loops > apcsaLoopsConcatInclusiveDescending
prev  |  next  |  chance

Given two numbers a and b, build a String that contains every number from a to b, inclusive. Now however, you must go down instead of up. Precondition: a > b for all inputs.


HINT: This is very similar to the earlier problems except now you have to decrement (decrease) your loop control variable instead of increment (increase) it.

apcsaLoopsConcatInclusiveDescending(5, 3) → "543"
apcsaLoopsConcatInclusiveDescending(10, 8) → "1098"
apcsaLoopsConcatInclusiveDescending(3, -2) → "3210-1-2"

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

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

Copyright Nick Parlante 2017 - privacy