January 4, 2018
Power often accrues to individuals who are very effective in their jobs or to firms that enjoy sustained high performance. If this is so, how is power different from basic competence, efficiency or performance?
January 4, 2018

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 [email protected] 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: