Question: c++ Declaration of class : #ifndef List_H #define List1_H #include Using namespace std; Class List { friend ostream &operator public: List(int = 5); //default constructor

 c++ Declaration of class : #ifndef List_H #define List1_H #include Usingnamespace std; Class List { friend ostream &operator public: List(int = 5);

c++

Declaration of class :

#ifndef List_H

#define List1_H

#include

Using namespace std;

Class List {

friend ostream &operator

public:

List(int = 5); //default constructor with size

List (const List&); //copy constructor

~List(); //destructor

int lengthIs() const; //return the number of elements in the List

bool isFull() const; //returns true if the list is full, false otherwise

bool isThere (int element) const; // returns true if the element

// is present in the list, false otherwise

bool operator==(const List & ) const; // equality operator;

List & operator++( ); //pre-increment

const int& operator[](int index)const;//subscript operator

const List &operator=( const List & ); // assignment operator

virtual void insertItem(int item) = 0;

virtual void deleteItem (int item) = 0;

protected:

int numItems; // current number of items within the list

int maxSize; //max number of elements that can be stored in the list

int *ptr; // pointer to the dynamic array that holds the list elements

};

#endif

You have the declaration of a list of integers, presented below as an inheritance hierarchy Using List as an abstract class, one can derive two subclasses, sorted list (SortedList) and unsorted list (UnsortedList). SortedList stores integers in sorted order whereas UnSorted list stores integers the way user enters them. List SortedList UnSortedList The declaration of the class List is given below #iindef List,H #define List 1H #include-qOstream> Using namespace std; - Class List friend ostream &operator Using namespace std; - Class List friend ostream &operator

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!