Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribedimage text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle Autonomous Database In Enterprise Architecture

Authors: Bal Mukund Sharma, Krishnakumar KM, Rashmi Panda

1st Edition

1801072248, 978-1801072243

More Books

Students also viewed these Databases questions

Question

What are the advantages of running experiments?

Answered: 1 week ago

Question

1.who the father of Ayurveda? 2. Who the father of taxonomy?

Answered: 1 week ago

Question

Commen Name with scientific name Tiger - Wolf- Lion- Cat- Dog-

Answered: 1 week ago

Question

12-5 How will MIS help my career?

Answered: 1 week ago