This is regarding assignment 2 for CMPUT 299, at University Of Alberta submitted by Ritvik Khanna
All the codes in problems 1,2,4 were taken from http://inventwithpython.com/hacking/ in the download source and other files for this book. As stated in the assignment only necessary changes were made to the program to solve the problems. Except the minor changes made in the program I did not write the rest of the code and is a work of AI Sweigart and was downloaded from the above said website. My solution is highly based on the source code as mentioned by professor Greg Kondrak. I have made all the programs user friendly which asks the user to what to do and the arguments WILL HAVE TO be passed through the command line.
-
Problem 1: Same solution as the source code except arguments are taken from the command line instead.
-
Problem 2: Same solution as a2p1.py except a counter is used to see for the 0th position shift it according to the passed key and then shift the rest of the text according to the previous character.
-
Problem 3,5: In a2.pdf
-
Problem 4: Same solution as a2p2.py except the counter is used to shift the first ‘n’ (n being the the length of the key) positions according to the corresponding nth position in the key after that starting from the first position shift it according to the previous character in the text passed and according to the mode.