I need help with the caesar cipher homework assignment, I am stuck and I do not know where to go in this problem. THis is the decoder which moves all the letters back three, but I do not know what is missing..
import java.io.*;
import java.util.Scanner;
public class AssignmentSix {
public static void main(String[] args) throws IOException {
//open file
FileReader inputFile = new FileReader("cipher.txt");
PrintWriter outputFile = new PrintWriter("plain.txt");
//loop the characters of input file
while(inputFile.ready()){
char ch = (char) inputFile.read();
//decode the character
char decodedChar = decode(ch);
outputFile.print(decodedChar);
}
//close files
outputFile.close();
inputFile.close();
}
public static char decode (char ch){
char result = ch;
if(charactersLetter(ch)){
char upperCaseLetter = Character.toUpperCase(ch);
int unicodeVale = (int) upperCaseLetter;
int decodedVale = unicodeVale - 3;
if( decodedVale < 65){
decodedVale += 26;
}
result = (char) decodedVale;
return result;
}
if(Character.isUpperCase('A')){
char val = Character.toUpperCase('a');
}
}
public static boolean charactersLetter(char ch) {
return
}
}