//**************************************************************************** // Programmer: Sriram Pemmaraju // Date: 9/2/2002 // This is the header for the SmallList class //**************************************************************************** #ifndef SMALLLIST_H #define SMALLLIST_H #include using namespace std; /* MODIFICATION MEMBER FUNCTIONS void readNumbers(int size); precondition: size is some non-negative integer postcondition: reads integers from the input into the list. the number of integers to read is given by size void sort(); precondition: none postcondition: the list contains integers in sorted (non-decreasing) order void removeDuplicates(); precondition: none postcondition: the list contains integers in sorted order with duplicates removed void writeNumbers(); precondition: none postcondition: writes the elements in the list to the output CONSTANT MEMBER FUNCTIONS int size() const; precondition: none postcondition: returns the size of the list */ class SmallList{ public: void readNumbers(int size); void sort(); void removeDuplicates(); void writeNumbers(); int size() const; private: static const int MAX_SIZE = 1000; int myList[MAX_SIZE]; int mySize; }; #endif