CSCI 2720 Data Structures Spring 2004 General Instructions for Programming Projects OVERVIEW: Submission will be both electronic, with a deadline of 12:00 PM on the day due, and by hard copy in the next class meeting. Be sure your printed files are the same as the ones submitted electronically. Each project will be graded out of 100 points and will comprise 7% of the overall course grade. Any submission which is early by at least 12 hours will earn 5 bonus points. Late submissions will be penalized 5 points for each 12 hours or part thereof past the deadline. Programming style, conformity to the project specifications, and correctness will all be factored into the grading. ENVIRONMENT AND COMPILER: Your program must compile and run correctly on atlas (the workstations are in the process of being replaced, so the environment may be different; from a workstation open a window on atlas). The compiler you must use is g++ in the gcc-3.3.2 suite. On atlas this is in the directory /usr/local/gcc/gcc-3.3.2/bin and you can make sure that's the one you are using by executing either "which g++" or "g++ -v" on atlas. If the wrong version shows up (there are at least two older versions on atlas) then you'll need to edit your .cshrc file so that the line starting something like set path = (/bin /usr/local/bin .... has the above directory listed near enough to the front (here it could go right after /bin and before /usr/local/bin). WARNING: for assessment purposes your code will be compiled on atlas using the g++ compiler in the directory noted above. If you develop your code initially on a different platform (OS, compiler, or even a different installation) be aware that porting it to atlas may be difficult. Bear that in mind when selecting your development environment. TESTING AND TIMIING: See the link from "Sample Code for Timing" on the course home page for an example showing how to use the library routines to read the system clock. The times you measure should be at least 2.0 seconds in duration for accuracy. You can achieve this by appropriate choice of size and/or repetition parameters. Do your debugging and testing for small parameter values, and increase the numbers in several stages before your final timing runs. Your final timing runs should all be on atlas. SUBMISSION PROCEDURE: We illustrate with project #1; for later projects substitute p2 for p1, etc. In your home directory on atlas make a subdirectory named "cs2720p1" and put copies of your project files in it. They should include one or more header files, one or more class implementation files, one or more files containg the code for your timing experiments, a file containing the results of your timing experiments along with your explanations and analysis of those results, a makefile, and READ.ME (information for the person grading the project). LOGGED ONTO ATLAS and in your home directory execute the command line "submit cs2720p1 cs2720a". Do NOT use the tab key: see the link from "Submit Command Notice" on the course home page for more details. Print out hard copies of the files above and bring them to class to turn in. Include your name and signature on your printouts, indicating that this is your own work. REQUIRED INTERFACE: The following must be EXACTLY as specified in the project description: * names of the files to be submitted; * names of the required classes and member functions; * return and input types of the required member functions. Also, arrange your #include directives so that the xxx.cc files include the xxx.h files rather than vice versa. See the sample makefile and the explanation preceding by following the link "Sample Makefile" from the course home page. This is a departure from what you are used to from earlier courses, but is necessary in order for g++ to compile code containing templates. The net effect of these requirements will be a standard interface which will allow your data structure implementations to compile with the instructor's test program without making any changes. Some projects are provided with code you can use to test your interface, as for example that linked from "Test for Project #1 Interface" on the course home web page. GRADING: Grading will be based on correctness, completeness, and style. The main elements of style are: * Each function in your .cc files should have a comment explaining what it does. * Code should be clear (structure) and easy to read (formatting). * Error checking should be performed whenever global new is called. * Use one of the modern explicit casts when changing types; often static_cast(oldType instance) will be appropriate, or reinterpret_cast(oldType instance) if necessary (the latter is always allowed, no matter how unsafe). See Section 6.2.7 of Stroustrup. * Use 0 for the null pointer. This is safer in C++ than the macro defining NULL to be 0 which is popular in C. * Use modern include files, such as instead of . This entails adding "using namespace std;" or else the namespace qualifier std:: for each library function when it is called, e.g., std::cout instead of cout. See the timing demo code for an example. * Use ** wherever appropriate to simplify code which involves chasing pointers. See a sample of code and an explanation with it by following the link "Pointer to Pointer to Node Example" from the course home page.