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

 

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

Write a method that "scrambles" a string of lower-case letters, 'origText' using a key, 'key'. The key will contain every lower-case letter from "a" to "z" exactly once, but in any order. The key is used to convert the 'origText' into a coded message by replacing every letter in 'origText' by the letter immediately following that letter in 'key'. Look at the test data for specific examples.


test2023_12_07_SLHL_scramble("test", "zyxwvutsrqponmlkjihgfedcba") → "sdrs"
test2023_12_07_SLHL_scramble("thegame", "abcdefghijklmnopqrstuvwxyz") → "uifhbnf"
test2023_12_07_SLHL_scramble("testing", "qwertyuiopasdfghjklzxcvbnm") → "yrdyomh"

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

public String test2023_12_07_SLHL_scramble(String origText, String key) { }

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

Copyright Nick Parlante 2017 - privacy