Welcome to the CSE142 Encryption Machine The program lets you encrypt a message with a key for your recipient to decrypt! Encrypted messages use a shared keyword to decrypt. Enter key: cseonefortytwo...


PLEASE DON'T USE "IF" OR "RETURN" STATEMENTS AND NOOOO "\N","\" VALUES EITHER


Welcome to the CSE142 Encryption Machine<br>The program lets you encrypt a message<br>with a key for your recipient to decrypt!<br>Encrypted messages use a shared keyword to decrypt.<br>Enter key: cseonefortytwo<br>

Extracted text: Welcome to the CSE142 Encryption Machine The program lets you encrypt a message with a key for your recipient to decrypt! Encrypted messages use a shared keyword to decrypt. Enter key: cseonefortytwo "cseonefortytwo" has been encrypted to: fvhrqhiruwbwzr How many words is your message? 4 Next word: computer "computer" has been encrypted to: frpsxwhu Next word: science "science" has been encrypted to: vflhqfh Next word: is "is" has been encrypted to: lv Next word: awesome "awesome" has been encrypted to: dzhvrph Message fully encrypted. Happy secret messaging!
As usual, we recommend you approach the program in stages, rather than trying to complete everything at once. Specifically, we suggest implementing<br>functionality in the following order:<br>1 Single letter: Write a method to encrypt a fixed single letter with a fixed shift of 3.<br>2 Parametrized letters: Modify your single letter encryption method to be able to encrypt any letter in your alphabet with a shift of three.<br>You'll need to have implemented your ALPHABET constant to do this.<br>3 Single word: Once your single letter encryption method completely works, write a method that encrypts a single word with a shift of 3 by calling<br>your single letter method.<br>4 User input: Prompt the user for a key and a message to encrypt and output the encrypted ciphertext.<br>5 SHIFT constant: modify your program to use a constant to determine the amount to shift characters by.<br>Hints<br>Remember that you can find the index of a specific character within a String with the index0f(char) method<br>You can also find the character at a specific index within a String with the charAt(int) method<br>To allow for characters wrapping around the alphabet, it might be helpful to think of the alphabet as being circular. Use the mod (%) operator to wrap<br>around!<br>If your program is generating InputMismatchException errors, you are likely reading the wrong type of values from your Scanner (for example, using<br>nextInt to read text).<br>

Extracted text: As usual, we recommend you approach the program in stages, rather than trying to complete everything at once. Specifically, we suggest implementing functionality in the following order: 1 Single letter: Write a method to encrypt a fixed single letter with a fixed shift of 3. 2 Parametrized letters: Modify your single letter encryption method to be able to encrypt any letter in your alphabet with a shift of three. You'll need to have implemented your ALPHABET constant to do this. 3 Single word: Once your single letter encryption method completely works, write a method that encrypts a single word with a shift of 3 by calling your single letter method. 4 User input: Prompt the user for a key and a message to encrypt and output the encrypted ciphertext. 5 SHIFT constant: modify your program to use a constant to determine the amount to shift characters by. Hints Remember that you can find the index of a specific character within a String with the index0f(char) method You can also find the character at a specific index within a String with the charAt(int) method To allow for characters wrapping around the alphabet, it might be helpful to think of the alphabet as being circular. Use the mod (%) operator to wrap around! If your program is generating InputMismatchException errors, you are likely reading the wrong type of values from your Scanner (for example, using nextInt to read text).
Jun 09, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here