This is NOT a required part of lab 3. This is an problem that is designed to really challenge you, and you should not attempt it until you have completed the other problems in lab 3.
We think this is a difficult problem. We do not expect that students should be able to solve it at this point in the semester; the solution requires using only things you know at this point, but the algorithm is a bit tricky. Therefore, if you try it, and don't get it, that is fine. What is important is that you can successfully do the regular problems in the lab 3 assignment.
This problem extends the cyclic cipher problem in the following way:
The ascii values for '0' to '9' are less than those for 'A' to 'Z' are less than those from 'a' to 'z', however they are non-contiguous between the three sets. For this program you will treat the following set as if it was contiguous, and do a cyclic cipher over it:
'0' '1' ... '9' 'A' 'B' ... 'Z' 'a' 'b' ... 'z'For example, if the user enters the string "09 AZ az" and a cyclic shift value of 1, your program will encode the string as "1A Ba b0". Unlike the problem above, in this encoding 'Z' does not shift around to 'A' but to the next value in our sequence, which is 'a', 'z' does not cyclic shift around to 'a' but to the first item in our sequence which is the character '0'.
Here are some runs of a working solution to give you an idea of how this encoding should work:
$ python super_encoder.py This program encodes a phrase using a cyclic cipher Enter a phrase: Hello There agent 007... Enter a shift value: 3 The encoded phrase is Khoor Wkhuh djhqw 33A... $ python super_encoder.py This program encodes a phrase using a cyclic cipher Enter a phrase: AZaz09 Enter a shift value: 6 The encoded phrase is Gfg56F $ python super_encoder.py This program encodes a phrase using a cyclic cipher Enter a phrase: AZaz09 Enter a shift value: -3 The encoded phrase is 7WXwx6 $ python super_encoder.py This program encodes a phrase using a cyclic cipher Enter a phrase: AZaz09 Enter a shift value: 20000 The encoded phrase is k9AZaj $ python super_encoder.py This program encodes a phrase using a cyclic cypher Enter a phrase: This is really cool! I totally get this mod thing, 100% Enter a shift value: 5 The encoded phrase is Ymnx nx wjfqq3 httq! N ytyfqq3 ljy ymnx rti ymnsl, 655%