This lab will give you practice regular expressions.
You should work in your groups (2 members). If your partner is not present in class each will need to complete the assignment on your own by the due date/time.
- Deitel’s book.
- This assignment grade sheet for this lab already printed out.
- USB Flash drive(s) or other storage media.
- Your laptop with Microsoft Visual Studio 2015.
The window for this assignment contains one text box, one list box, one label, and one button. The label initially has no text. The user types a five-letter word (lowercase) into the text box and presses the button. Be kind to your user and place cursor in the text box and interpret
<Enter> as Go button key press. Provide accelerator (Alt+G) for the Go button.
Your program should use regular expressions to verify that the user has entered exactly five letters (lowercase) into the text box. It’s not necessary that the five letters actually form a word. If the value typed isn’t five lowercase letters, issue an appropriate message and allow the user to enter another five-letter word. After the input has been verified, rearrange the letters of the word to form as many valid threeletter words as possible. List these in the list box in alphabetical order. Then change the label to indicate how many three-letter words were found.
As an example, if the five-letter word is “bathe”, you might list the following words in the list box: ate, bat, bet, tab, hat, the, tea, … The words would be in alphabetical order in the list box.
To help you out, you can download a text file containing a list of words from Webster dictionary. Download the data file called “webster.txt” from Canvas. Right-click on the filename and select Save Target As to save this file in the bin\Debug subdirectory of your project folder. Use only the three letter words in this list of words to determine the valid words for the list box, i.e., do not read the entire dictionary into memory for use by your program.
Don’t worry about trying to turn this into an n-tier application. You can put all the code into the Form class if that’s convenient for you.
Omit duplicate words from the list, i.e., for “asset”, include the word “set” only once.
Each of your source files should contain a documentation header with description, author name, class information (CS3160, Spring/Fall 20xx). Each function should have a documentation header with minimally function name, description, parameters, return value. Use proper program style at all times which means indentation, alignment, and whitespace. Utilize self-documenting code which means use mnemonic, i.e., meaningful variable/function/namespace/class names, etc.
Submit compressed (.zip) solution folder via Canvas.
In your solution folder make sure that all necessary files to compile/link/execute your projects are provided.
Here are some files that may be required
- All required C# source files (.cs)
- makefile (if the solution requires it)
- The entire Visual Studio 2015 solution folder (if the solution requires it)