I am fairly new to programming in general and I was wondering how I could encode/decode text that is inputted.
All letters must be brought down 3 letters for ex A -> D B -> E and so forth
Ill put in some pseudocode for an example:
INPUT MESSAGE: "LORYHBRX"
Encoded Message:LORYHBRX
Decoded Message:ILOVEYOU
OUTPUT MESSAGE: "ILOVEYOU"
Please help.
So far I have
import java.util.*;
public class Encoder {
public static void main(String[] args)
{
String a = "d";
String b = "e";
String c = "f";
String d = "g";
String e = "h";
String f = "i";
String g = "j";
String h = "k";
String i = "l";
String j = "m";
String k = "n";
String l = "o";
String m = "p";
String n = "q";
String o = "r";
String p = "s";
String q = "t";
String r = "u";
String s = "v";
String t = "w";
String u = "x";
String v = "y";
String w = "z";
String x = "a";
String y = "b";
String z = "c";
Scanner in = new Scanner(System.in);
System.out.println("Please enter the text you wish to encode.");
String place = in.nextLine();
System.out.println(place);
}
}
I'm trying to convert what is inputted into the variables above.
I think I am stating all those strings as variable but I do not know how to make them changeable by the input.