Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please help. Thank you! This is java programming(BlueJ) CM-111 Spring 2018 Assignment 6: The Cesar Cipher Due 3/8/2018 Background Jullus Caesar is credited with using

Please help. Thank you! This is java programming(BlueJ) image text in transcribed

CM-111 Spring 2018 Assignment 6: The Cesar Cipher Due 3/8/2018 Background Jullus Caesar is credited with using this simple substitution encoding scheme to protect military messages. Caesar used a key of three to substitute the letters of the original message with the characters three places away in the alphabet. Here is an example A Caesar cipher using a key of 3 and a right shift The original message: ATTACK THE ENEMY Encoded message: DWWDFN WKH HQHPB Since spaces can reveal information to help decipher the code, spaces would be removed Final encoded message: DWWDFNWKHHQHPB With a key of 3 and right shift, a letter in the original message is replaced by the letter three places to the right. To decipher an encoded message, you find the coded letters in the alphabet, and replace them with letters 3 letters to the left. We can visualize this by juxtaposing the letters of the alphabet above an alphabet shifted three characters. Find the letter to encode in the upper list and replace it with the character in the lower list. To decode, find coded letters in the lower list and replace with top letter. ABCDEFGHUKLMNOPQRSTUVWXYZ DEFGHUKLMNOPORSTUVWXYZABC Assignment Write a program that will encode and decode messages your class caesarcipher using the Caesar cipher with a right shift. Name The program will: 1. Prompt for the key; a number between 1 and 25. 2. Prompt for E for encrypt or D for Decrypt. 3. Prompt for the message to encode/decode. 4. Encode or decode the message. Remove all spaces before encoding. 5. Print the encoded or decoded message. 6. Prompt for q to quit or Enter to encode/decode another message. 7. The program should keep looping to encode/decode messages until Q is entered

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Management Databases And Organizations

Authors: Richard T. Watson

6th Edition

1943153035, 978-1943153039

More Books

Students also viewed these Databases questions