EECS 183 Labs

EECS 183 Lab 10: Mini Ciphers

Lab due on your scheduled lab day (April 7 - 9)

Lab accepted for full credit until Monday, April 13 11:59 pm Eastern

Build-and-submit lab (no starter files)

In this lab, you will create a small C++ project from scratch in your IDE (Xcode or Visual Studio) and implement a mini ciphers program for the Atbash cipher.

By completing this lab assignment, you will learn to:

No Starter Files

There are no starter files for this lab. You must create your own project and files.

Required Files

Your submission must include:

A typical, and recommended, structure is:

Program Requirements

Your program must:

Atbash Cipher Rules

Atbash replaces each letter with its mirror letter in the alphabet:

Case must be preserved:

Any character that is not a letter should stay exactly the same (spaces, punctuation, digits, symbols).

NOTE: Atbash is its own inverse. Running Atbash twice returns the original message.

Error Handling Before Cipher

Before calling the cipher function, check whether the input message contains at least one alphabetic character. If it does not, print:

Error: message must contain at least one alphabetical character.

and do not run the cipher.

Sample Runs

When you run your program, it should behave per the examples below. Assume that the red text is what some user has typed.

NOTE: The following sample runs define the required output behavior used by the autograder tests.

Sample Run 1

Atbash Cipher Mini-Lab
Enter a message to encode: Hello, World!
Encoded message: Svool, Dliow!

Sample Run 2

Atbash Cipher Mini-Lab
Enter a message to encode: Svool, Dliow!
Encoded message: Hello, World!

Sample Run 3

Atbash Cipher Mini-Lab
Enter a message to encode: The grasshoppper lies heavy.
Encoded message: Gsv tizhhslkkkvi orvh svzeb.

Sample Run 4

Atbash Cipher Mini-Lab
Enter a message to encode: ZyGoMa
Encoded message: AbTlNz

Sample Run 5

Atbash Cipher Mini-Lab
Enter a message to encode: Chungus the squirrel is hungry
Encoded message: Xsfmtfh gsv hjfriivo rh sfmtib

Sample Run 6

Atbash Cipher Mini-Lab
Enter a message to encode: 183 !!!
Error: message must contain at least one alphabetical character.

IDE-Specific Setup Guides

Use one of the detailed setup pages: