COSC 3353 Assignment 4
Purpose: To allow each student to demonstrate that they can solve a problem in C# that effciently uses the features of the C# language.
Due: Before class on March 18 (late assignments will not be accepted)
1. You are to write a software program that solves this problem. The problem came from 'Car Talk' on NPR.
What is the longest English word, that remains a valid English word, as you remove its letters one at a time? Now, letters can be removed from either end, or the middle, but you can't rearrange any of the letters. Every time you drop a letter, you wind up with another English word. If you do that, you're eventually going to wind up with one letter and that too is going to be an English word-- one that's found in the dictionary. I want to know what's the longest word. What's the word, and how many letters does it have? I'm going to give you a little modest example: Sprite. Ok? You start off with sprite, you take a letter off, one from the interior of the word, take the r away, and we're left with the word spite, then we take the e off the end, we're left with spit, we take the s off, we're left with pit, it, and I. Obviously, the word I'm looking for is much longer. I think there's more than one of them. In fact I know there's more than one word. And I should mention plurals are not involved and proper names are not allowed. What is the longest word that meets these criteria?
We will slightly modify the problem as follows:
Longest word: SPRITE, length = 6, Proof: SPITE, SPIT, PIT, IT, I
Run Time= 12.4 seconds
The program you are to write must meet these criteria:
2. Word list. Here is the word list to use in your search. The list is a combination of words taken from two web sites, Kevin's Word List Page and All Words Legal in WOL2 (a scrabble word list). This list is unsorted, with a space between each word. You may not change this word list in any way. If a problem is found in the list, notify the instructor, who at his discretion will post a revised list.
3. All output should be to the console. You should minimize output, since it significantly slows execution time. This does not mean you should minimize debug code in your program, but instead you should have a way to turn this code off for final execution.
4. All programs must be properly documented. The program should include extensive comments.
Lab Report. Prepare a lab report that contains the following information:
Submission: You will be submitting this lab via email. Attach all of the files to your email. This package will then be forwarded to other students so they can do a code review.
Questions: All questions on the problem, data files, or presentation must be asked in class or by email. The instructor will reply to questions via email with a copy to all class members. This is to allow all student to know the same information. If you send an email and I do not reply within 24 hours, please call or come see me.
Grading Criteria: The primary grading criteria for the exam is the quality of your program design, the use of the C# language features, and correctly solving the problem. 25 bonus points will be awarded, if your program is faster or equals the instructors run time on the same test machine, as long as the correct answer is arrived at.