Creating a code breaker

Lesson Aim

  • Reinforce creating a program using Procedures and Functions

Your Task

Code Maker (and Breaker) – Lite Version
Write a program that will do the following:

         • Print a menu:
            Code Maker (and Breaker)
            1 – Encode a letter
            2 – Decode a letter
            9 – Exit

Enter an option:
• If ‘1’ is entered, prompt for a letter and use a selection statement to convert the letter into an integer (a = 1, b = 2, etc.).
• If ‘2’ is entered, prompt for an integer, check it is valid (prompt again if invalid) and convert the integer into a letter.
• If ‘9’ is entered, print a goodbye message and exit (break)
• If another value is entered, print an error message and print the menu again.