Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Create a JavaScript function that accepts three parameters, and returns the Caesar Cipher encrypted text. Reference the Caesar Cipher Wikipedia page to learn more about
Create a JavaScript function that accepts three parameters, and returns the Caesar Cipher encrypted text. Reference the Caesar Cipher Wikipedia page to learn more about the technical specifications of the Caesar Cipher.
Function name: CaesarEncrypt(clearText, shiftNum, shiftLeft)
Parameters:
- clearText: the unencrypted string
- shiftNum: the integer number of positions to shift, default to two positions shift
- shiftLeft: the Boolean value of whether the shifting is left (true), or right (false), default to left shift is true
Return: Encrypted text using the parameter values.
Output: No output
You will ONLY encrypt (i.e., shift) uppercase or lowercase alphabetic characters, and numbers. All other characters are returned unshifted.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started