Lecture notes for the Introduction to multidisciplinary Computer Science II by James Tam | Return to the course web page |
This version of the program still employs the same encryption algorithms that you used in the previous assignment: the Caesar Cipher variant and the bitwise negation. But you are to expand upon that simple program so that it can now read the text to be encrypted from a text file specified by the user. The program will allow the user to select the method of encryption and the encrypted text will be written to a second text file. Finally you will implement a second program that reverses the process: it reads from the encrypted version of the text and writes an decrypted version of the text to a third file. You would have already gotten credit for the parts of the assignment that were the main focus of the previous assignment, e.g., the encryption algorithms, so those parts of the assignment won't be graded in this subsequent assignment.
|
|
|
|
|
|
You are to write a program that will read the text from the file "data.txt" into an array. Each line of text from the file will be read into a row of the array. The program will then analyze the text in the file and generate the following information: a character count, a word count and a sentence count. The full version of the program will then use a system call to dictionary check each word in the document via the program "dict". Because the output of the program is likely to scroll through many screens full of information, your program should be written so that it can work using UNIX redirection (i.e., it should not ask the user for any input while it's running). Finally a debug mode will be implemented that shows the individual words from the input file that are looked up in the UNIX dictionary.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dict Blue dict skys dict to dict forever | |
In this case the user won't be able to turn the debug mode on and off at a prompt from the program because the output is supposed to be redirected so you should simply use a variable to determine if your program is in debug mode or not. You (and your marker) can toggle debug mode (and the display of the debugging messages on/off) by editing the program to change the value of the variable. The program documentation should make it clear how the debug mode is supposed to work and how to engage/disengage it. |