Please help I would like when I enter a phrase in this program where the same letter in the words would like to encrypt will not be used twice E.g. To encrypt: Character Encrypted: Ingxgizkx We see...

Please help I would like when I enter a phrase in this program where the same letter in the words would like to encrypt will not be used twice E.g. To encrypt: Character Encrypted: Ingxgizkx We see that for the letter a there are two g’s2 import java.util.;<br>3 public class Main<br>5<br>public static boolean isALetter(char letter){<br>if( (letter = 'a' && letter <= 'z') || (letter = 'A' && letter <= 'Z'))<br>return true;<br>return false;<br>public static int putkeyInRange (int encryptKey){<br>11<br>int num;<br>12▼<br>13<br>14<br>if(encryptKey>=-32767 && encryptKey<=32767){<br>num=(encryptKey26)+1;<br>return num;<br>15<br>16<br>System.out.prrìntln(

Extracted text: 2 import java.util.; 3 public class Main 5 public static boolean isALetter(char letter){ if( (letter = 'a' && letter <= 'z')="" ||="" (letter='A' &&="" letter=""><= 'z'))="" return="" true;="" return="" false;="" public="" static="" int="" putkeyinrange="" (int="" encryptkey){="" 11="" int="" num;="" 12▼="" 13="" 14="" if(encryptkey="">=-32767 && encryptKey<=32767){ num="(encryptKey26)+1;" return="" num;="" 15="" 16="" system.out.prrìntln("invlaid="" input="" key="" :");="" return="" -1;="" 17="" 18="" 19="" 20="" public="" static="" char="" encode="" (char="" letter,="" int="" encryptkey){="" return="" (char)((int)letter+encryptkey);="" 21="" 22="" public="" static="" char="" decode="" (char="" letter,="" int="" encryptkey)="" {="" return="" (char)="" ((int)letter-encryptkey);="" 23="" 24="" 25="" 26="" public="" static="" void="" main(string="" []="" args)="" {="" 27="" i="" scanner="" sc="new" scanner="" (system.in);="" system.out.print("enter="" a="" message:="" ");="" string="" m-sc.nextline="" ();="" system.out.print("enter="" a="" key:="" ");="" int="" key="sc.nextInt();" string="" encryptmessage="" ;="" string="" decryptmessage="" ;="" int="" encryptkey="putKeyInRange" (key);="" 1/encryption="" process="" for(int="" i="0;ia.length();i++){" if(isaletter(m.charat(i)))i="" 28="" 29="" 30="" 31="" 32="" 33="" 34="" 35="" 36="" v="" 37▼="" 38="" encryptmessage+="encode" (m.charat="" (i),="" encryptkey);="" 39="" 40v="" elsef="" 41="" encryptmessage+="m.charAt" (i);="" 42="" 43="" 44="" decrypt="" process="" for(int="" i="">
Jun 02, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here