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[]

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!