| This project will investigate reading and processing text files. |
| Do the following: |
- You will create a program that will read a text file and
perform various text processing procedures. Your main form
should consist mainly of a menu and a text box. You will
place a few other controls on the form for statistics display
and user input (as described below), but the majority of the
form should consist of the text box.
- Create a menu that has
five commands: "Open", "Save", "Close", "Exit", and "About"
-
"Open" - Will ask the user to select a text file (with the open
file dialog), will read in that text file, storing it in a
string, and display it in a text box on the form. It will
also clear any previous statistics that are displayed.
- "Save"
- Will prompt the user for a file name that will save the text
in the text box out to a new file. Don't allow the user to
save over the top of any previously loaded file.
- "Close" -
Will erase the text out of the text box and clear any previous
statistics that are displayed.
- "Exit" - Will exit the
program.
- "About" - Will display an about box with your name
and project title (as in previous projects).
- The "Save" and
"Close" menu items should be grayed out appropriately, i.e., if
no file is open, they should be grayed. Also, if a file
has been opened, but not modified, then the "Save" menu should
be grayed as well.
- You should also have a button on your form
called "Calculate" that when pressed will calculate statistics
on the text in the text box. It should also be grayed
appropriately when there is no file opened.
- When the
"Calculate button is pressed, you should perform a number of
searches. Find the number of times the words "And" "Of"
and "The" are in the document (ignoring case). Find the number of
sentences in the document. Find the number of words in the
document. Display the results as you wish on the surface
of the form.
- Also, you should have another small text box
with a corresponding buttons labeled "Search", "Next".
This will allow the user to enter a regular expression and
search for it in the text in the text box. When "Search"
is clicked, you should search for the regular expression.
If no matches are found, you should display a message box
stating so. If any matches are found, show in a label
control the number of matches found, and highlight the first
match in the text box.
- When the "Next" button is clicked,
highlight the next match and so forth until all matches have
been displayed. At which point display a message box
saying there are no more matches.
- The text I will use to test
your code can be found here.
Turn in your finished project by "zip"ing up your entire solution
folder including any and all project files, resources, and code
files and place it in your folder on the FTP site. |
|