Caesar Cipher Hints

Here is an example algorithm for the shift cipher. Do it your way.

  1. Create and initialize (set to blank) three variables to store inputText, shiftValue, and outputText.
  2. Plaintext (or cleartext) is normal unencrypted text.
  3. Ask the user to enter a plaintext message to be encoded. Set the inputText variable to the answer from the user.
  4. Ask the user to enter a shift value for the shift cipher. If their answer is a number:
    • Set the shiftValue variable to their answer.
    • Ask the user if they wish to encode or decode.
    • Then call a custom procedure to encrypt or decrypt the data. Here is an example encode algorithm. You could:
      • Use it and write a decode reporter block on your own.
      • Modify this into a encode/decode block that uses negative shift values to decode.
      • Or create your own custom procedure and ignore the example.
      Encode (text) (shift #) code example
      Notice that Encode reporter relies on a simpler reporter, Encode One Character, that encodes a single character by shifting it a given amount. This abstraction makes the code easier to manage.
  5. Here are enough blocks to build Encode One Character:

  6. Check that your code works as expected.