about | help | code help+videos | done | prefs |
Write a method called encode that accepts a String of 26 upper-case letters and a char containing an upper-case letter. The method returns the encoded version of the char. The encoding works by finding the letter in the String that corresponds to the alphabetical position of the char in the alphabet. Use the letter at that location in the String as the encoded version of the char. This is a simple replacement code. encode("THEQUICKBROWNFOXJUMPEDOVER", "P") → "X" encode("ABCABCABCABCABCABCABCABCAB", "M") → "A" encode("BCDEFGHIJKLMNOPQRSTUVWXYZA", "J") → "K" ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 205
Copyright Nick Parlante 2017 - privacy