Question: NEED HELP ASAP! I'm trying to build a Caeser Cipher in Netbeans and I need it to this: Build a translate methodpublic static String translate(String
NEED HELP ASAP! I'm trying to build a Caeser Cipher in Netbeans and I need it to this:
- Build a translate methodpublic static String translate(String inText, int key)that accepts the provided text and Key.
- Translate must be a method with the header/signature shown above.
- Build a driver method.
- Take sufficient screenshots to demonstrate that your program meets all requirements.
- Include the execution output of your program to convince a reader that it functions properlyboth encoding and decoding messages.
- Test your program with both positive and negative Key values and text strings containing both alphabetic and nonalphabetic characters.
- Paste these screenshots into an MS Word document.
- For your final test, you use must use the following input: 3 Am, mbv 83 urwoio, cd wue . . .
- Create a .zip file containing your NetBeans Caesar Cipher project.
- Before zipping your project, right-click the project and "clean" it. This greatly reduces the file size and speeds up the program's performance.
Here is my code:
package TestProjectWeek3;
import java.util.Scanner;
public class TestProjectWeek3 {
public static void main(String[] args) { //Main shows that this is where the code is starting Scanner in = new Scanner(System.in); System.out.println("Caesar Cipher Implementation"); int key=0; String text=""; while(true) { text=""; try { System.out.println("Enter the key and text seperated by space: "); String[] s = in.nextLine().trim().split(" "); key = Integer.parseInt(s[0]); //Where I'm seeing error for(int i=1;i Heres the error message I'm receiving: run: Caesar Cipher Implementation Enter the key and text separated by space: -3 Am Encrypted Text: XXAjmQ Enter the key and text separated by space: mbv 83 urwoio ERROR: Key is not an Integer. Enter the key and text separated by space: cd wue ERROR: Key is not an Integer. Enter the key and text separated by space: BUILD STOPPED (total time: 2 minutes 46 seconds)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
