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

 

orion.a.smith@gmail.com apcsa-encryption > apcsaEncryptCaesarStringPassword
prev  |  next  |  chance

Given an input String and a password, return the String after a key-character Caesar cipher where all the input letters are shifted up by corresponding letters in the password ('A'==1, 'B'==2 etc.). After the last letter in the password is reached, the algorithm will wrap around to use the first letter again. Precondition: the input String will have only capital letters in it, the password will be all capital letters too.


apcsaEncryptCaesarStringPassword("ABCDEFGHIJKLMNOPQRSTUVWXYZ", "PASSWORD") → "QCVWBUYLYKDEJCGTGSLMRKOBOA"
apcsaEncryptCaesarStringPassword("HI", "B") → "JK"
apcsaEncryptCaesarStringPassword("THISMACHINEKILLSFASCISTS", "ABC") → "UJLTODDJLOGNJNOTHDTELTVV"

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

public String apcsaEncryptCaesarStringPassword(String str, String password) { }

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

Copyright Nick Parlante 2017 - privacy