Instructions for Laboratory #2 Assignment -- COM1201 Sp2000 -- Professor Futrelle

The lab is Wednesday, April 26th and due on Tuesday, May 2nd, at the beginning of class.

This first explains the general goals of the lab, then the specifics, and finally the mechanics of just what needs to be handed in. These project files will be made available to you before the lab is given, so you can get a head start.

Here are some last-minute details (4/25/2000) about setting up your project and getting the source file downloaded cleanly and renamed properly.

The general goals are for you to:

More specifically, you are to do the following:

  1. Design the records you want to use. It would be a good idea to do this in advance. Every student in the class must use a distinct record design.
  2. Build and run a simple console project using the code that I have written. Be sure to have the medrecordbase.dat file in the same folder as your project and source code. See the Lab2 web pages for more on how to do this.
  3. Start modifying my code by adding your class and adding the various reading and printing functions for your classes. My code can be downloaded from this lab web site. Change the .text extension of the code to .cpp to use it. By choosing slightly different names, you can do the additions without having to delete anything that I wrote, so you can keep them around for reference. When you're all done and everything works, you can delete my classes and functions from the source file (.cpp) file to clean it up. Of course you can toss my stuff earlier if you want; it's up to you.
  4. You should design and carry out a systematic set of tests. I'd suggest something like the following.
  5. Comment your code. Some comments should be grouped before a class or function, others might be at the detailed code level. Please don't put one comment for every line of code. Use better judgement than that.
  6. Work on the documentation of your project, which should include what you did, how you did it, what your results were, and most importantly a discussion of your results, and conclusions. Results don't "speak for themselves"; they must be explained to be worth anything.

Some of the logistical details:

What to hand in. (Keep this in mind as you work on your project.)

Stable and Unstable Sorting

Sedgewick explains this concept rather well on page 271. The major point to understand is in a stable sort, if a set of records is sorted by key A and then the resulting file is sorted by key B, every set of records with the same value of B will sort together and the A records in that set will retain their original order. For example if my medical records file had some of the age values the same in different records and a stable sorting algorithm was used then the following would happen: If the file was first sorted by names, they would be in alphabetical order. If the resulting file was sorted by age then it would have a set of records of equal ages, e.g., each 15 months, grouped together, but the records with age 15 would retain the previously sorted order for the names.

Good Luck and enjoy the project!