This website is preserved for historical and scholarly reference and is no longer actively maintained.
                         CpSc 241, Section 1
                             Assignment 3
                           2 February 2000


Due: Wednesday, February 9 at midnight

Late penalties: 20 points per partial day late.  That is, programs
	turned in after midnight Wednesday and before midnight Thursday
	will have 20 points deducted for late, programs turned in after
	midnight Thursday and before midnight Friday will have a total
	of 40 points deducted for late, etc.

Total point value of assignment:  100 points

Late submissions not accepted after: Sunday, February 13 at midnight

This assignment is to be done INDIVIDUALLY.



Create a directory, A3, which will contain all parts of this assignment.
You will need class ListNode and class ListItr as from the text, but,
instead of making class List a friend you should make class OrderedList
a friend.  (You may have both class List and class OrderedList, but
note that OrderedList is not allowed to inherit from class List 
because and OrderedList cannot insert except to keep the List ordered.)
  

The objectives of this program are to give you some more experience working
with the classes in Chapter 3 and to give you practice with C++ pointers
and templates.

Your first task is to examine the methods of class List and decide
which are appropriate for an OrderedList and which need to be changed.
The class will maintain the list in ascending order.  The Objects
must be Comparables (page 30).  Instead of passing an iterator to
the insert method, the insert method will determine where to place
the object and insert the object.  

Next, you will make changes in copies of ListNode and ListItr so that
OrderedList is a friend.

Finally, you will adapt the methods of class List in order to construct
class OrderedList.

The main() will be called a3.cc or a3.cpp, whichever you choose.  Submit
all files in directory A3 using handin.


Input:

	Using cout and cin, request the user to enter a positive integer,
	num, between 1 and 10, inclusive.  Keep instructing the user to
	enter such a positive integer until s/he does so or has had
	three tries.  After 3 tries, if num has not been correctly
	entered, select num to be 5.

	Using the (pseudo) random number generator from this week's lab,
	generate num random numbers and call insert to insert the 
	random integers in the OrderedList.
	

Output:

	Before reading the input, print your name, the assignment number,
	and a short description of the assignment to the screen.

	Using the code from Figure 3.10 (page 76) of the text,
	together with appropriate text, print the OrderedList.
	(This code will need minor adjustments.)


Other requirements:

	Follow the style standards to be found from your instructor's
	web page for CPSC 241.


Grading rubric:


	In the opinion of the instructor the program is an honest attempt
		to complete the assignment as described  20 pts.

	If the above requirement is met:

		Required documentation 10 pts.
		Style standards 20 pts.

	If the two previous requirements are not met, no further points
		will be awarded.

	OrderedList algorithms are correct and optimum.  10 pts.

	The program compiles without error, reads the input correctly,
	and OrderedList works correctly.  40 points