Question: JAVA Programming Specifications Add 2 public static methods to your CaesarCipher class . These are overloads of the methods that you already have. These methods

JAVA Programming

JAVA Programming Specifications Add 2 public static methods to your CaesarCipher class.

Specifications

Add 2 public static methods to your CaesarCipher class. These are overloads of the methods that you already have. These methods will make writing the next class easier.

Method name: encrypt

Input: 1 char, 1 int

Output: 1 char

Purpose: Encrypts the input character using a Caesar cipher. The cipher should use the input integer as the key for the cipher.

Example:

Input: 'H', 7 Output: 'O' 

Method name: decrypt

Input: 1 char, 1 int

Output: 1 char

Purpose: Decrypts the input character using a Caesar cipher. The cipher should use the input integer as the key for the cipher decryption.

Example:

Input: 'O', 7 Output: 'H' 

Write a class called "FileEncryptor" with the following public static methods.

Method name: encryptFile

Input: 2 String, 1 int. (first parameter is the input file name, second parameter is the output file string, and third parameter is the encryption key)

Output: nothing

Purpose: Encrypts the input file using a Caesar Cipher and the key given as an argument and writes the result to the output file.

Note 1: you must handle 3 special characters: ' ', ' ', and '\t'. These character should not be encrypted.

Note 2: you must throw an Exception if a non-printable character or ' ', ' ', or '\t' is found in the file.

Method name: decryptFile

Input: 2 String, 1 int. (first parameter is the input file name, second parameter is the output file string, and third parameter is the encryption key)

Output: nothing

Purpose: Decrypts the input file using a Caesar Cipher and the key given as an argument and writes the result to the output file.

Note 1: you must handle 3 special characters: ' ', ' ', and '\t'. These character should not be encrypted.

Note 2: you must throw an Exception if a non-printable character or ' ', ' ', or '\t' is found in the file.

Write a class called "Driver" that you can use to test that your file encryption/decryption works.

Method name: main

Input: 1 String array

Output: nothing

Purpose: Use this method to test your classes. Before you submit to the submission server, comment out all code in the main method.

Add 2 public static methods to your CaesarCipher class. These are overloads of the methods that you already have. These methods will make writing the next class easier Method name: encrypt Input: 1 char, 1 int Output: 1 char Purpose: Encrypts the input character using a Caesar cipher. The cipher should use the input integer as the key for the cipher. Example Input: H7 Output: 'GO Method name: decrypt Input: 1 char, 1 int Output: 1 char Purpose: Decrypts the input character using a Caesar cipher. The cipher should use the input integer as the key for the cipher decryption Example: Input: 'O7 Output: 'H

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!