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

 

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

Write a method that returns a string made up of all the letters from 'first' to 'last'. The two character parameters will either both be upper-case letters or both be lower-case letters. Also, 'first' will always come before 'last' alphabetically or will be the same letter as 'last'. You do not need to check for these conditions. You may assume these conditions as preconditions. For example, if 'first' is 'D' and 'last' is 'H' you would return the string "DEFGH". Look at the test data for additional examples. NOTE: You MUST use a loop of some kind to solve this problem!


test2023_10_05_APP1SLHL_letters("A", "C") → "ABC"
test2023_10_05_APP1SLHL_letters("r", "r") → "r"
test2023_10_05_APP1SLHL_letters("y", "z") → "yz"

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

public String test2023_10_05_APP1SLHL_letters(char first, char last) { }

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

Copyright Nick Parlante 2017 - privacy