I have been tasked with with creating a caesar cipher that has a main method, and has other methods named exactly how they want them within my project requirements.
I have been emailing my Teacher's assistant back and forth on this to get help but since I will say that we haven't been directly told anyway on how to properly shift the ASCII lettering so I've been trying to look around on google and here a bit and they have it set up to not use as many methods as I've been asked or it's in the C language.
My question as it stand is, for netbeans IDE 8.1 what is the proper code to get it to shift the .txt file.
If anyone asked I'll put up my rubric if it is asked of me.
package mcintosh_project3;
import java.io.File;
import java.util.Scanner;
/**
*James McIntosh
*Project 03
*/
public class McIntosh_Project3
{
public static void main(String[] args, int option) throws Exception
{
boolean run = true;
File inputfile;
if (option == 1)
{
Scanner input = new Scanner(System.in);
System.out.println("What text file would you like to encrypt?");
String inputFile = input.nextLine();
}
if (option == 2)
{
Scanner input = new Scanner(System.in);
System.out.println("What text file would you like to decrypt?");
String inputFile = input.nextLine();
}
if (option == 3)
{
run = false;
}
if (option > 3)
{
System.out.println("Invalid option, please choose again.");
}
}
public static int getMenuOption() throws Exception
{
int option;
Scanner input = new Scanner(System.in);
System.out.println("1. Encrypt");
System.out.println("2. Decrypt");
System.out.println("3. Quit");
System.out.println("What would you like to do?");
option = input.nextInt();
return option;
}
public static int key(File inputfile, int option) throws Exception
{
public static int key(File inputfile, int option) throws Exception
{
char key = 'a';
if (option == 1)
{
key += 5;
}
if (option == 2)
{
key -= 5;
}
return key;
}
public static void encrypt(File inputFile, int key, int option) throws Exception
{
if (option == 1)
{
key += 5;
}
System.out.println(inputfile); //incorrect as of right now
}
public static void decrypt(File inputFile, int key, int option) throws Exception
{
if (option == 2)
{
key -= 5;
}
}
}