Project #2 – Book Cipher
Course INFO-1156 Object-Oriented Programming in C++
Professor Janice Manning
Assigned July 3, 2018
Due Monday, July 23, 2018 by 11:59 pm
Weight 5%
Student Name
Project Description
Create two C++ console applications; one that encodes a text message using a book cipher, and
another that decodes the message coded by the previous program.
Program Interfaces
The encoder should have the following command-line interface:
bcencode.exe bookfile messagefile codedfile
The decoder should have the following command-line interface:
bcdecode.exe bookfile codedfile resultfile
Where:
• bookfile is the name of the ASCII text file containing the book used to encode/decode
the message.
• messagefile is the name of the ASCII text file containing the message to be encoded
• codedfile is the name of the ASCII text file containing the line/offset numbers
• resultfile is the name of the ASCII text file containing the decoded message
Encoding rules
Encode each character of the message file by replacing it with a set of numbers, matching that
character in the book. The first number represents the line in the book (zero-based), and the
second number represents the offset to that character in that line (also zero-based. Any method
of choosing which set for a char from the book file to use is acceptable as long as the same set is
not used repeatedly.
At the end of running bcencode, a coded file is created with sets of numbers.
At the end of running bcdecode, a result file is created from the coded file.
The coded file will be a file containing the character locations from the book file representing the
message file characters. For example:
bookfile: “ABCDEFGHIJKLM\nNOPQRSTUVWXYZ”
messagefile: “WORLD”
codedfile: 1 9 1 1 1 4 0 11 0 3
Encoding background
To read more about encoding messages using the book cipher see:
https://en.wikipedia.org/wiki/Book_cipher
Grading Criteria
Functional Requirements
Encoder works
• Correct use of command line arguments
• Creates a code table from book
• Creates a coded message
• Uses full ASCII table
40% 40%
Decoder works
• Correct use of command line arguments
• Creates a char representation of book
• Creates a decoded message
• Uses full ASCII table
40% 40%
Both programs report errors if any of the input files
cannot be opened (indicating which file was the
problem).
10% 10%
The encoder program reports and quits if the message
cannot be encoded by the book file (i.e. A character in
the message to be encoded does not exist in the book
file), and reports which character cannot be encoded.
10% 10%
Non-functional requirements
Executables program are not named ‘bcencode.exe’ and
‘bcdecode.exe’
-10% / each
Coded message uses the same index repeatedly for the
same letter.
A program does not print an appropriate title to the
console
-20%
Penalties from C C++ Grading Guide v1.1.0
A guide to code/comment style. can be found at C++ Style.
Various
Late submission
• One to five days late
• More than five days late
-10%/day
-100%
Total 100% 100%
Submission
1. Submit entire Visual Studio project directory to Fanshawe Online
a. Delete all debug and release directories.i
b. Submit in a .ZIP, .7z archive file.
i Alternatively, you can ‘clean’ your project for submission by downloading ‘vsclean’ a Visual Studio Solution
Cleaner from www.gats.ca .