Question: this is my code so far. public class CaesarCipher { protected char[] encoder = new char[26]; protected char[] decoder = new char[26]; protected char[] encoder2
this is my code so far.
public class CaesarCipher { protected char[] encoder = new char[26]; protected char[] decoder = new char[26];
protected char[] encoder2 = new char[26]; protected char[] decoder2 = new char[26]; public CaesarCipher(int rotation) { for (int k = 0; k
public String encrypt(String message) { return transform(message, encoder); // use encoder array }
public String decrypt(String secret) { return transform(secret, decoder); // use decoder array }
private String transform(String original, char[] code) { char[] msg = original.toCharArray(); for (int k = 0; k
public class Test {
public static void main(String[] args) { CaesarCipher cipher = new CaesarCipher(3); String message = "There is a Book on the Table"; String coded = cipher.encrypt(message); System.out.println("Secret: " + coded); String answer = cipher.decrypt(coded); System.out.println("Message: " + answer);
}
} ![this is my code so far. public class CaesarCipher { protected char[]](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f3a96de7ad2_65366f3a96d79d25.jpg)
P-3.34 Write a program that can perform the Caesar cipher for English messages that include both upper- and lowercase characters
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
