Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Objective: One of the simplest cipher algorithms is the Caesar cipher, where each letter in a message is shifted by a fixed number. For example,

image text in transcribed
Objective: One of the simplest cipher algorithms is the Caesar cipher, where each letter in a message is shifted by a fixed number. For example, a RIGHT shift of 3 would make the letter A into D, B into E, C into F and so on. You can read more about it on Wikipedia: https://en.wikipedia.org/wiki Caesar cipher In this homework you will create a program that will allow the user to enter a word, an indication of whether to shift left or shift right, and the amount to shift by. Your program should then output the encoded word to the screen. Your program must perform the following tasks: 1. 2. 3. Your program should be named homework2.cpp You can assume that the user will enter words with letters a-z and A-Z Your program must continually loop and keep asking the user for new words and must quit only if the user enters q! Once the user enters a word you must ask the user to specify a direction by entering the word RIGHT or LEFT. The user must enter the words exactly as they are shown, otherwise you should print out that you do not recognize the direction 4. 5. Once the user has entered the direction, you must ask the user for the shift amount. You must make sure the user does not enter a number less than 1 or greater than 26. If the user does you must print out that the shift amount is incorrect. Your program should then print out both the original word and the encoded word. Your program 6. 7. should be submitted via Polaris using the following command You need to submit only The homework will be graded using the following grading scheme Objective Compiles with no errors or warnin Comments to help the reader understand the Points 20 10 uits when user enters q! Recognizes RIGHT and LEFT, shows error message when a 15 Recognizes shift amount between 1 and 26, shows error message otherwise 15 25 ate Performs shift operation and shows original and encoded word Total 100

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions