CEG 2170L -05 Project 3:
Implementing a Substitution Cypher with an Array of
Structures
November 06, 2017
In this project we will create a look-up table in the form of
an array of structures and use it to encrypt messages into
numeric-codes and decrypt numeric codes into human-readable
messages.
DESCRIPTION:
1. Prompt the user for a text filename. Read the contents of
the file into an array of structures. The file will contain
up to 90 records, each record containing a character and
a number. The file containing the conversion codes is
provided. Following shows its contents:
​z38
Y40
k42
.46
x43 ​

Assume each character corresponds to a number with
exactly two decimal digits (10 <= number <= 99), and
each two-digit number corresponds to a unique character.
Project+3+Description.docx.pdf
Saved to Dropbox • Nov 8, 2017 at 10@21 AM
2. Read the contents of the conversion file to an array of
structures.
3. Print out the following USAGE message to the screen.
Then print “Enter Command:” to the screen and wait for
user’s input.
USAGE:
Command to encrypt a message to a numeric code:
encrypt <sentence>
e <sentence>
Command to decrypt a numeric code to a readable
message:
decrypt < number-code>
d <number-code>
To Exit program, enter
quit or q.
4. If user input starts with
encrypt (or e), convert each
alphabet in the <sentence> to the two-digit number
associated with it in the array. Print the encrypted
numeric code to the screen.
5. If user input starts with
decrypt (or d), convert every
two numeric digits to a character and print it to the
screen.
6. If user input is
quit (or q) exit the program.
7. For any other input, print an appropriate error message.
ASSUMPTION:
Examples of user input are:
​ ​What is 3 times 10?
​ ​What is three times ten?

The <number-code> in a decrypt input should have an
even number of digits. Following are valid <numbercode> inputs:
​ ​
199694463258 (Nov. 6)
​ ​669396 (Two)
Input is case sensitive
The program encrypts characters (numbers, symbols, and
lower- and upper-case letters).
REQUIREMENT:
If the program cannot find the correspondence to an input
character during encrypting, an appropriate error
message should be printed out. If the program cannot
find the correspondence to a two-digit number during
decrypting, again it should print an appropriate message.
Make sure to read all characters on an input line,
including spaces and symbols.
Example:
encrypt CEG 217-0 class
SUBMISSION:
Name your program LastName_FirstName_Project3.c
and upload it to the Dropbox under Project 3 no later
than 2:00 pm on November 13.


What Students Are Saying About Us

.......... Customer ID: 12*** | Rating: ⭐⭐⭐⭐⭐
"Honestly, I was afraid to send my paper to you, but you proved you are a trustworthy service. My essay was done in less than a day, and I received a brilliant piece. I didn’t even believe it was my essay at first 🙂 Great job, thank you!"

.......... Customer ID: 11***| Rating: ⭐⭐⭐⭐⭐
"This company is the best there is. They saved me so many times, I cannot even keep count. Now I recommend it to all my friends, and none of them have complained about it. The writers here are excellent."


"Order a custom Paper on Similar Assignment at essayfount.com! No Plagiarism! Enjoy 20% Discount!"


0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *