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

 

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

Write a method that uses recursion to return a string made up of all the characters from 'firstChar' to 'lastChar'. Your solution MUST use recursion! I suggest making a helper method with a very short name so you don't have to use the huge method name in your recursive call(s). As preconditions, you may assume that the two input parameters will be alphabetic letters and that they will have the same case (either BOTH upper- or BOTH lower-case). Look at the test data for examples. REMINDER: Your solution MUST use recursion in a meaningful way.


test2025_05_22_APP1SL_recursivelyBuiltString("a", "e") → "abcde"
test2025_05_22_APP1SL_recursivelyBuiltString("e", "z") → "efghijklmnopqrstuvwxyz"
test2025_05_22_APP1SL_recursivelyBuiltString("B", "T") → "BCDEFGHIJKLMNOPQRST"

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

public String test2025_05_22_APP1SL_recursivelyBuiltString(char firstChar, char lastChar) { }

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: 270

Copyright Nick Parlante 2017 - privacy