DRAFT: Open for comment in the discussion forum.

Homework 1: fsu::List<T>

Educational Objectives: After completing this assignment, the student should be able to accomplish the following:

Operational Objectives: Supply source code implementing the template classes List<T> and ListIterator<T>. Code should be thoroughly tested for functional correctness, robustness, and memory management. The supplied code should function correctly and be free of memory leaks, and your tests should provide evidence of both. This evidence should be summarized in a test report.

Deliverables: Three files: list.cpp, name.com, log.txt

List API

List Implementation Plan

Procedural Requirements

  1. Begin with understanding the chapters on Lists and Deques and a working knowledge of the techniques involved in creating linked structures dynamically.

  2. The official development/testing/assessment environment is the environment on the linprog machines.

  3. Make sure you understand the implementation plan for List<T> described above.

  4. Work within your subdirectory called cop4530/hw1. Keep in mind that with all assignments it is a violation of course policy and the FSU Honor Code to give or receive help on assignments from anyone other than the course instruction staff or to copy code from any source other than those explicitly distributed in the course library.

  5. Copy the following files from the course LIB into your hw1 directory:

    LIB/tests/flist.cpp
    LIB/tests/mlist.cpp
    LIB/tcpp/list.h
    LIB/hw1/list.cpp.partial
    LIB/hw1/makefile
    LIB/hw1/hw1submit.sh
    
  6. Create three more files:

    1. a source code file list.cpp implementing the template classes fsu::List<T>, fsu::ListIterator<T>, and fsu::ConstListIterator<T> that are defined in tcpp/list.h. There are only a few missing implementations.
    2. a text file name.com that is a command file for flist.cpp [ElementType = char] such that:
      1. The characters of your first name are inserted into x1 in alphabetical order, with the first letter capitalized
      2. The characters of your last name are inserted into x2 in alphabetical order, with the first letter capitalized
      3. Finishing with the commands to accomplish x3 = x1; x3 += x2; x3.Display(cout) results in printing your name to screen.
      4. Note character insert order is alphabetical, and traversal order spells your name.
      For example, the file name.com depicted here:
      #
      # name.com
      # 
      # input order:     Chirs acehLr
      # traversal order: Chris Lacher
      #
      
      11C
      12h
      12i
      1a
      1++
      1++
      1ir
      12s
      21a
      22c
      22e
      2a
      2++
      2++
      2ih
      21L
      22r
      3=1
      3+=2
      3d
      q
      
      results in "ChrisLacher" to screen.
    3. a text file log.txt consisting of a log of all development activity, including documentation for all testing. All three files should be placed in the hw1 directory.

  7. Keep detailed notes on procedures and results as you test your implementation list.cpp. Use these testing notes to create a report in the file log.txt.

  8. Turn in the files list.cpp, name.com, and log.txt using the script hw1submit.sh.

  9. Warning: Submit scripts do not work on the program and linprog servers. Use shell.cs.fsu.edu to submit this assignment. If you do not receive the second confirmation with the contents of your project, there has been a malfunction.

Technical Requirements and Specifications

  1. Your file list.cpp is a "slave" file to list.h. (See the chapter on Vectors for an explanation of "slave" file.)

  2. Your implementation should follow the plan detailed above.

  3. Much of the implementation is given in the file list.cpp.partial. You supply the missing implementations.

  4. Your implementation of List<T>, ConstListIterator<T>, and ListIterator<T> should be tested for both functionality and memory containment using at least the classes T = char and T = fsu::String. Two test programs, clients of fsu::List<T>, are supplied. Specific instructions for testing for memory leaks are included as comment at the top of the file mlist.cpp. DO NOT TEST FOR MEMORY LEAKS WITHOUT FOLLOWING THESE INSTRUCTIONS.

  5. Document all testing in your log.txt, which will be collected by the submit script.

Hints: