// CS2310 Exercise 7 // // Name ____________________ SSN ____________________ // // Chapter 13 // p761 - 2: To this chapter's List class, we wish to // add a value-returning member function named // Occurrences that receives a single parameter, item, // and returns the number of times item occurs in the // list. // // SPECIFICATION FILE ARRAY-BASED LIST ( list.h ) const int MAX_LENGTH = 50 ; typedef int ItemType ; class List // declares a class data type { public : // public member functions List ( ) ; // constructor bool IsEmpty ( ) const ; bool IsFull ( ) const ; int Length ( ) const ; // returns length of list void Insert ( ItemType item ) ; void Delete ( ItemType item ) ; bool IsPresent( ItemType item ) const ; void SelSort ( ); void Print ( ) ; int Occurrences ( ItemType item ) const; // The added function. private : // private data members int length ; // number of values currently stored ItemType data[MAX_LENGTH] ; } ;