Question: Square code is a simple transposition cipher that utilizes a square (or rectangle) arrangement of your plain text to create a ciphertext. You will write

Square code is a simple transposition cipher that utilizes a square (or rectangle) arrangement of your plain text to create a ciphertext. You will write a program that allows the user to type a message of any length, then encode it using an appropriately sized 2D array Requirements: .Name the source file for your program program8.cpp .Prompt the user to type in a message - You must strip all whitespace and common punctuation marks Tabs, spaces, new lines, and carriage returns count as white space Period, comma, apostrophe, exclamation mark, and question mark count as com- mon punctuation The message will then be inserted into a dynamic 2D array - The dynamic array will always have 12 columns - It is up to you to determine how many rows are required You are only expected to encode the message . A sample run of your program shall look like: NOTE: The message and encoded output are both just one line, breaks were added for visibility NOTE: The '#' are actually in the array Enter a message to be encoded: If you want to know what a man's like, take a good look at how he treats his inferiors, not his equals. J.K. Rowling NOW WHAT AMANS LIKETAKEAG0 0 D L00 KATHOWHE TREAT SHISIN F ERORSN0THS INLDTEEI FOILRRON YWKOEIUG OWEOA0A UHTKTRL WAAASSS ATKTHNJ NAEHIOK TMAOSTR TAG IHO ONOHNIW KSOEFSL Hints: . You will be making heavy use of the string class to parse the message and insert it into the array - Familiarity with some string class function will be very beneficial - Functions such as find first of) or find last of), and erase() .A dynamcic 2D array requires special care to set up and properly destroy No functions are required, but they should be used Reminders: . Be sure that your program includes your name, ID, description, etc. as shown in the General Homework Requirements Handout . Use good style including indentation, comments, etc. Part of the grade will be for style and ua .Carefully test your program. .You are welcome to write your program at home. If you do, be sure to compile and test it in the lab before submitting it
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
