Task 1 (Warm up)
a) Write a function that prints the integers from 1 to 100 (inclusive).
But:
for multiples of three, print 'Three' (instead of the number)
for multiples of five, print 'Five' (instead of the number)
for multiples of both three and five, print 'ThreeFive' (instead of the number)
The output should be:
1, 2, Three, 4, Five, Three, 7, 8, Three, Five, 11, Three, 13, 14, ThreeFive, 16, 17, Three, 19, Five, Three, 22, 23, Three, Five, 26, Three, 28, 29, ThreeFive, 31, 32, Three, 34, Five, Three, 37, 38, Three, Five, 41, Three, 43, 44, ThreeFive, 46, 47, Three, 49, Five, Three, 52, 53, Three, Five, 56, Three, 58, 59, ThreeFive, 61, 62, Three, 64, Five, Three, 67, 68, Three, Five, 71, Three, 73, 74, ThreeFive, 76, 77, Three, 79, Five, Three, 82, 83, Three, Five, 86, Three, 88, 89, ThreeFive, 91, 92, Three, 94, Five, Three, 97, 98, Three, Five
The problem can be presented as the lowest level of comprehension required to illustrate adequacy.
b) Make another function which will work for 4 primes (3,5,7,11)
Task 2 (Caesar Cipher)
https://en.wikipedia.org/wiki/Caesar_cipher
Implement two functions which will encode and decode the message using Caesar Cipher.
Right shift of 23
Plain: ABCDEFGHIJKLMNOPQRSTUVWXYZ
Cipher: XYZABCDEFGHIJKLMNOPQRSTUVW
So the program output should be:
Plaintext: THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG
Ciphertext: QEB NRFZH YOLTK CLU GRJMP LSBO QEB IXWV ALD
Say why the code in a bad encryption technique.