
Chapter 16: Prelab Assigment
Templates, Operator Overloading, and Exceptions | 411
Name __________________________________________ Date _______________________
Section _________________________________________
Read the following class declaration in file SortedList .h carefully and answer Exercises 1
and 2.
// File SortedList.h contains the specification for a
// sorted list.
const int MAX_ITEMS = 20;
typedef int ItemType;
class SortedList
{
public:
SortedList ();
// Constructor
// Post: Empty list is created.
// Action responsibilities
void Insert(ItemType item);
// Pre: The list is not full.
// Post: item is in the list; list is stored in
// increasing order. ...