[MSOE Homepage]

Dr. Taylor's MSOE Homepage

Unix is a Four
Letter Word

My Photo Album

My Personal Homepage

CS-285 Main page

Q & A

CS-285 -- Lab 1: Spell Checker using list

Winter Quarter 1999-2000



Electrical Engineering and Computer Science Department
Dr. Christopher C. Taylor

CC-27C, 277-7339

www.msoe.edu/~taylor/

Purpose

The purpose of this lab assignment is to review the string, vector, and list classes. This is accomplished through designing and implementing a C++ program to spell check text files against a dictionary file containing correctly spelled words.

Assignment

In order to do this assignment, you will need to download two files:

  • dict.txt contains an alphabetical listing of correctly spelled words.
  • example.txt contains a short paragraph of text.

You should write a C++ program that identifies any words in the example.txt file that are not contained in the list of correctly spelled words (dict.txt). In the process, you should create at least two classes. One class, for the example.txt file, should make use of the string and vector classes to store each word in the example.txt file in a vector of strings. The other class should make use of the list class to store each word in the dict.txt file in a list of strings.

Programming consideration: It is always good in program design to consider potential modifications that may be required a some later date. Be sure to keep this in mind when designing your program. Think about what additional things you might want a spelling program to be able to do.

Program Extras

Since many of you may not have used C++ recently, this lab should serve as a programming review. As a result, some of you may find that the assignment does not provide a significant enough challenge. There are a number of ways in which you can expand this assignment to make it more interesting. Here are a few ideas that you may decide you would like to implement:

  • Spell correction -- allow the user to input the correct spelling of the word that was mispelled (or choose not to change the word).
  • An additional user dictionary -- allow the user to add correctly spelled words that are not in the dictionary.
  • GUI -- a graphical user interface using MFC.
  • Spell checking in context -- display the mispelled word in the context of the text file you are spell checking.
  • Global ignore/replace -- allow the user to treat all additional instances of a misspelled word in the same way.

The list above is not meant to be exhaustive, feel free to emblish your program with any other features that you would like your spelling checker to have. However, please keep in mind that you should meet the minimum assignment requirements before adding additional components.

Intermediate Lab report (due 11:00pm, the day prior to week 3 lab)

The intermediate report should consist of your class declarations and a brief discussion of your reasoning for defining the classes as you did.

Lab report (due 11:00pm, the day prior to week 4 lab)

The lab report should be self-contained. That is, it should be possible for someone to understand what you did and why without seeing anything other than your report. Your report should include:

  • Purpose
  • Problem Statement
  • Procedure -- what approach you used to solve the problem
  • Documented source code (you may wish to include this at the end of your report)
  • Discussion (include your program output (the misspelled words), the reasons for defining the classes as you did (from the intermediate lab report), any problems you encountered, etc...)
  • A summary of your activity log indicating how much time you spent on each phase of the assignment. Please report the time in the following categories:
    • Design
    • Coding
    • Debug (before you think it's working)
    • Test (after you think it's working)
    • Documentation
    • Other
  • Conclusions (what you learned, suggestions of how the lab could have been better, things you would have done differently, etc.)

As with any report you submit, correct spelling and grammar are required. In addition, your report should be submitted electronically following the Electronic Submission Guidelines. (You may wish to consult the sample report before submitting your report.) Be sure to keep copies of all your files, in case something gets lost. It may be wise to keep a diskette backup as well.

IMPORTANT NOTE: Be sure to save your program for future use. We will revisit this assignment later in the quarter.

If you have any questions, consult the instructor.


This page was created by Dr. Christopher C. Taylor, copyright 1998, 1999.