Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Complete the C program message _ encipher.c , which scans in a message and enciphers it . Each message will consist of a total of

Complete the C program message_encipher.c, which scans in a message and enciphers it.
Each message will consist of a total of 4 letters. To encipher a message, we will scan in 4 numbers to add to each of these letters.
For example, if we have the message
"comp"
And, we scanned in the following 4 numbers:
527-2
Then, the message is enciphered to
"hqtn"
This is because:
'c'+5='h'
'o'+2='q'
'm'+7='t'
'p'+-2='n'
Pull up an ascii table if you want to double check this! You can do this with the command ascii -d run in the terminal.
In this exercise, you will only be given letters as input (can be lower or uppercase!) and will need to follow the rules above.
There are 3 important notes on our ciphering technique: - Input numbers can be negative, for example if we want to encipher 'g' with the number -5, then we get 'b'
- If an enciphered letter goes outside the range of "a-z" then it must wrap around. This means that if an input letter is 'y' and the corresponding input number is 4, then the enciphered letter is 'c'
- There is no limit on an input number. This means that we could have an input letter like 'h' with a corresponding input number 150 and the corresponding enciphered letter would be 'b'

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

Murach's SQL Server 2012 For Developers

Authors: Bryan Syverson, Joel Murach, Mike Murach

1st Edition

1890774693, 9781890774691

More Books

Students also viewed these Databases questions

Question

Provide examples of KPIs in Human Capital Management.

Answered: 1 week ago

Question

What are OLAP Cubes?

Answered: 1 week ago