![]() |
![]() |
Ciphers Computer Programming ProblemProblem DescriptionIn this problem, each letter of the alphabet corresponds to a number using the scheme: a=1, b=2, c=3, ... y=25, z=26. To encode a message, an encryption key word is "added" to the message. The key word is the first word in the message that is five or more characters long. For example, if the message were: give me liberty or give me death the key word would be liberty. The encrypted message would be: s r x j e y k u k g w l s n d p k a w g d p n c y z The first letter, s, results from adding 7 for the letter g to 12 for the letter l. This results in 19 which is the letter s. The other letters are calculated in a like manner. The algorithm you develop should wrap around to the beginning of the alphabet if the sum of two letters exceeds 26. For example, when the letter l (12) is added to y (25) the sum is 37. There is no 37th letter in the alphabet. Therefore you should use 37 - 26 or 11 which is the letter k. The key word is repeated indefinitely to the end of the message. For example: give me liberty or give me death
-------------------------------- srxj ey kukgwls nd pkaw gd pncyz (Spaces are left between the words in this example for clarity. Do not include spaces in your results. ) Every message will have at least one five letter word. Spaces are not encrypted and not included in the output. Only messages in lowercase letters will be entered. No punctuation or special characters will be entered. Input/OuputWhen encrypting, the input will consist of a sentence or phrase entered via the standard input device. The output must be the key and the encrypted message. Only lower case letters will be entered soit is not necessary to edit the input. A text file will be provided with the sentences and phrases displayed below. You can copy and paste these for testing purposes to save time. These do not constitute the complete set of testing data the judges will use. Your application can be created to process a single set of data. That is, after processing a set of data, your application can end. You can then start the application again and enter a second set of data. If you use a graphical interface (Visual Basic, C#, ...) you can enter the data in text boxes and display the results in text boxes or labels. However, a graphical interface is not required for this application. Sample Input/Output
|
Want more information?Melinda White Get Admissions Info Did you know? |
| Altamonte Springs Campus 850 South State Road 434 Altamonte Springs, FL 32714 | Heathrow Campus 1055 AAA Drive Heathrow, FL 32746 | Oviedo Campus 2505 Lockwood Boulevard Oviedo, FL 32765 | Sanford/Lake Mary Campus 100 Weldon Boulevard Sanford, FL 32773 |
| A Diverse Learning Community...An Equal Access/Equal Opportunity College © Seminole Community College, 1996-2008 Privacy Policy About Us | Contact Us | Site Map | |||