V22.0002
ASSIGNMENT 9

Extra Credit
Due: Thursday, August 5th (The Day of the Final)


Write a program which DECRYPTS the secret messages which are created by the ENCRYPT program which we created in class.

It should first prompt the user for the scrambled alphabet which was created by ENCRYPT (which you should be able to copy & paste from the preceeding program's run). It then should ask for the secret message. Finally, it outputs the unscrambled version.

Note that there are exactly 26 characters input for the scrambled alphabet. All alphabetic characters are translated into their decoded equivalents (which will take a WHILE loop), and all other, non-alphabetic characters should be output exactly as they were without translation.

For extra credit, verify that the scrambled alphabet you input has only alphabetic characters and that they don't duplicate. Put out an error message if you find a duplicate letter.

Here is a possible sample run:


Please input the scrambled alphabet in order:
XQHAJDENKLTCBZGUYFWVMIPSOR

Now input the scrambled message:
VNKW KW BO 1WV WJHFJV BJWWXEJ!

Your unscrambled message reads:
THIS IS MY 1ST SECRET MESSAGE!