UMBC CMSC 202 Spring 2001 CSEE | 202 | 202 Spring 2001

Project 4
Notes and Clarifications

  1. 02 May 01
    A modification of the requirements regarding exceptions.

    The project description says "Exception classes must be defined in the .H file of the related object". This is hereby change to "Exception classes MAY be defined in the .H file of the related object. Those of you taking the minimial approach to exception classes will want to put them in the related .H file. Those of you who are more industrious and make full-fledged exception objects will want to define them in a separate .H and separate .C file. In fact, good software engineering would have you create separate .H and .C files for List exceptions, Stack exceptions and Queue exceptions.

    If you take this better approach there is more to do. For example, supppose you create stackexceptions.H and stackexceptions.C. The you will need to #includ stackexceptions.H in stack.H and modify your make file to compile stackexceptions.C to create stackexceptions.o which will be linked with the other files in your project. Please check with your instructor, TA or the help center if you need help with this.

    It is your responsibility to make sure all files you need to create your executable are submitted and that your executable is created by just typing "make".

    A bonus hint about exceptions -- if you're doing exceptions correctly, the upper-level code (isPalindrome) will be catching four different types of exceptions.

  2. 30 April 01
    Some students are having difficulty with List.H and Node.H when trying to make the List class a friend of the Node class. The problem arises because List.H includes Node.H and Node.H includes List.H (to declare the friendship). An easy way to solve this problem is to tell the compiler what List is, without including List.H -- this is accomplished with the following declaration in Node.H instead of including List.H template <class T> class List;
  3. 25 April 01
    As the project description states, all runtime errors must cause an exception to be thrown. There has been some questions regarding what may be thrown. One of the project obejectives is to learn about exceptions. Creating your own exception classes is part of that learning experience... therefore

    You MUST create your own exception classes to be thrown when a runtime error is detected.You MAY NOT throw strings or any built-in data type nor may you throw any of the "standard" exception classes.


CSEE | 202 | 202 Spring 2001