
Lesson 16-1: Check Prelab Exercises
Templates, Operator Overloading, and Exceptions | 413
Name __________________________________________ Date _______________________
Section _________________________________________
Exercise 1: Additional statements are in bold.
// File SortedList.h contains the specification for a
// sorted list.
const int MAX_ITEMS = 20;
typedef int ItemType;
template<class 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.
void PrintList();