AP CSA FRQ Guide
2011 FRQ 4: RouteCipher
Fill a 2D character block from a message and encrypt message chunks by reading the block in the route order.
2D Array String Encryption22 minute target2D arraysStringrow-majorcolumn-major
Skills Tested
What this FRQ is really practicing
2D arraysStringrow-majorcolumn-major
Review these topics before attempting the problem.
Starter Approach
How to begin with your own plan
- 1Fill the block in row-major order, padding short chunks with the required filler.
- 2Encrypt each block-sized chunk and concatenate encrypted chunks.
Attempt the problem before opening the solution.
Common Mistakes
Mistakes to watch for while writing
Forgetting padding for the final partial block.
Using the wrong chunk size.
Reading or filling in the wrong row/column order.
Self Check
Review questions before you submit
Fills the block by rows and columns.
Track the current character index while traversing the block.
Pads missing characters when the chunk is short.
The archive prompt specifies a filler character.
Processes the message in block-sized chunks.
The chunk size is rows times columns.
Calls the provided block encryption after filling each block.
Do not reimplement unrelated helper behavior if the prompt provides it.
Practice Links
