Sei sulla pagina 1di 2

Assignment 2

After reading this document you must execute the file demo.exe to understand the
whole concept. The exe file is attached with this document in the same zipped file.

At first your program should allow you to input two values, one should be a
word of 5 characters that is to be stored in a character array named
plaintext[5] and another is an integer value that will be stored in a variable
named key. A key is a part of the conversion that is used to convert the plain
text into a cipher text.
Sample Input and Output 1 :
If you enter a string hello as plaintext[5] and 2 as key, then the plaintext
is converted into a string like : jgnnq using the key and store the converted
string into an array named cipher[5]. It is done by replacing each of the
characters by the 2nd (because the key is 2) character after it and storing into
cipher[5] array.
After that without stopping that application, the same program will prompt
you to enter the cipher string jgnnq again to verify whether the typed
cipher text is correct or not. This time your program should convert back the
string to get a string like plaintext[5] using the same key. Then you will get
a string like the plaintext[5]. Now compare the converted string with the
plaintext[5]. If they are equal then it will say You entered correct cipher
text unless print You entered wrong cipher text.
Sample Input and Output 2 :
If you enter a string world as plaintext[5] and 3 as key, then the plaintext
is converted into a string like : zruog using the key and store the converted
string into an array named cipher[5]. It is done by replacing each of the
characters by the 3nd (because the key is 3) character after it and storing into
cipher[5] array.
After that without stopping that application, the same program will prompt
you to enter the cipher string zruog again to verify whether the typed
cipher text is correct or not. This time your program should convert back the
string to get a string like plaintext[5] using the same key. Then you will get
a string like the plaintext[5]. Now compare the converted string with the
plaintext[5]. If they are equal then it will say You entered correct cipher
text unless print You entered wrong cipher text.

INSTRUCTION !
1. Submit before : 08 April 2015, 11: 40 PM, Wednesday Night(sharp),
into your VUES account
2. Submission Guidline : .c file zipped in a file named as Your_ID.zip
3. All of you must attend a viva on your solution on or before 09 April
2015, Thursday.
4. If you miss then viva then you will get Zero(0) for this assignment

* Upload system will automatically be disabled after the submission


deadline
* You can discuss with me for any confusion regarding this
assignment
* All the students with same source codes will get Zero(0)

Potrebbero piacerti anche