The requirements for the first extra credit program is:

Write a program that will ask the user for a key to encrypted a message.  The user is to type in a twenty-six letter key.  Then the user is to enter some number of lines of plain-text.  After each line has been entered by the user, this program will substitute a letter from the key for the plain-text letter:

Plain:    A  B  C D  E  F   G  H  I   J   K  L   M  N  O P  Q R  S  T  U  V   W X  Y  Z



Key:     B  C  D E  F  G   H   I   J  K  L  M  N   O P Q  R  S  T  U  V  W X   Y  Z  A

Message:   This is a test
cipher:       UIJTJ TBUFT U

Your program must allow either upcase or lowercase input, but the output must be in uppercase.  Also, notice the cipher is
printed out as groups of five letters, with the last group not having that requirement.  The user will type a Control-D when finished.

Sample output:

umbc9[1]% cc extra.c
umbc9[2]% a.out
You must enter a cipher key that is 26 letters long.
Enter cipher key:
bcdefghijklmnopqrstuvwxyza
Enter plain text (Control-D to quit)
Plain:  hello
cipher: IFMMP
Plain:  my name is gary burt
cipher: IFMMP NZOBN FJTHB SZCVS U
Plain:  what is your name
cipher: IFMMP NZOBN FJTHB SZCVS UXIBU JTZPV SOBNF
Plain:

Email me (burt@umbc.edu) the typescript file on or before 22 Dec 98.
 

The requirements for the second extra credit program is:

The second program is an extension of the first where the user has the option to encrypt a message or decrypt the
last message.  Give the user a menu and allow them to pick one or the other.  Modify the first program, so that the key and the cipher are each written to a file (two files).  Check the book in Chapter 11 for examples of how to do file input and output.  You can pick the name for the files and automatically open the files and read them for decrypting.  The reverse of the encryption is to use the key and undo the substitution.  You do not try to get the characters back to the original word size.

Sample output:

umbc9[3]% cc extra2.c
umbc9[4]% a.out
    UMBC Secret Message Social Club

    1 -- Encipher text
    2 -- Decipher text

    Enter your choice:  1
You must enter a cipher key that is 26 letters long.
Enter cipher key:
bcdefghijklmnopqrstuvwxyza

Enter plain text (Control-D to quit)
Plain:  hello
cipher: IFMMP
plain:  my name is gary burt
cipher: NZOBN FJTHB SZCVS U
plain:  what is yours
cipher: XIBUJ TZPVS T
plain:  have a nice day
cipher: IBWFB OJDFE BZ
plain:
 

Email me (burt@umbc.edu) the typescript file on or before 22 Dec 98.