

  
  
  
  
  
  
  
  
  
  
  
  
  
  
  

![[Courses]](../icons/up.png)
![[Rich]](../icons/prev.png) ![[Home]](../icons/home.png) ![[Rich]](../icons/next.png)
![[Author]](../icons/author.png) |
Overview
In this lab, you should develop a better understanding
of the implementation details associated with the STL list class.
This is accomplished by implementing a simplified version of the STL
list class.
Procedures
You are to create a List class that:
- Makes use of templates so that objects from any class (with
a default constructor defined) can be elements of the list.
- And has the following member functions:
- empty() -- Returns true if list is empty.
- front() -- Returns first element in list.
- back() -- Returns last element in list.
- push_front() -- Adds a new element to the beginning of the
list.
- push_back() -- Adds a new element to the end of the list.
- pop_front() -- Deletes first element of the list.
- pop_back() -- Deletes last element of the list.
- begin() -- Returns an iterator that points to the first
element in the list.
- end() -- Returns an iterator that points to one past the last
element in the list.
- insert() -- Adds a new element to the list at a specific
location (indicated by an iterator).
- erase() -- Deletes either a single element (indicated by
an iterator) or a range of elements (indicated by two iterators) from
the list.
- remove() -- Delete all occurrences of a given value.
You may find it useful to create additional classes to aid in the
development of your List class. While there is a similar
implementation of this class given in our textbook, there are a number
of significant errors in its implemenation. I would suggest that you
use it only as a guide.
In addition to the above implementation, you should design a test program
that tests all of the functionality of the above
implementation.
Lab report (due 11:00pm, Tuesday, February 20, 2001)
The report need not be self-contained, but it should contain:
- A discussion of your design decisions including your reasons for
implementing any additional classes. In particular, you should
mention any places where you needed to be especially careful in
your implemenation of List class member functions.
- The Documented source code
for your program.
You may find it useful to use the
code.bat and
dump.bat batch files to produce
one file containing all of your source code with the markup commands
required by my electronic submission process.
- A discussion of your testing algorithm (explaining how it
tests all of the functionality of your List class
implementation).
- Sample output from your testing program
- A detailed discussion of how your team operated and what each team
member contributed to the project.
- A summary of your activity log indicating how much time you spent
on the assignment. In addition to the total time spent on the
project, 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.
Your grade will depend on quality of design, clarity of code and
documentation, as well as whether your program produces the correct
results. Note: This lab is worth double points. If
you have any questions, consult your instructor.
|