Write the definition of the class template ArrayListType, and the derived class unordered ArrayListType. Provide implementations for the non abstract functions in the base template class, and implementations of the template functions in the derived template class. Write a test program to test the functions in the derived template class. Instantiate objects of type derived class in your test program using template parameters of type float, int. You may use the example provided in the lecture slides. Many of the functions were implemented in the slides. Some were not implemented and you will have to implement them yourself in this lab. Below are the definitions of the base template class and the derived template class (from the lecture slides). template class arrayListType { public: const arrayListType & operator= (const arrayListType &); //Overloads the assignment operator bool isEmpty () const; bool isFull () const; int listSize () const; int maxListSsize () const; void print () const; bool isItemAtEqual (int location, const elemType& item) const; virtual void insertAt (int location, const elemType& insertItem) virtual void insertEnd (const elemType& insertItem) = 0; void removeAt (int location); void retrieveAt (int location, elemType& retItem) const; = 0; virtual void replaceAt (int location, const elemType& repItem) = 0; void clearList (); virtual int seqSearch (const elemType& searchItem) const = 0; virtual void remove (const elemType& removeItem) = 0; arrayListType (int size = 100); arrayListType (const arrayListType & otherList); virtual ~arrayListType ();

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
C++
Write the definition of the class template ArrayListType, and the derived class unordered
ArrayListType. Provide implementations for the non abstract functions in the base template class, and
implementations of the template functions in the derived template class. Write a test program to test
the functions in the derived template class. Instantiate objects of type derived class in your test
program using template parameters of type float, int.
You may use the example provided in the lecture slides. Many of the functions were implemented in
the slides. Some were not implemented and you will have to implement them yourself in this lab.
Below are the definitions of the base template class and the derived template class (from the lecture
slides).
template <class elemType>
class arrayListType
{
public:
const arrayListType<elemType> &
operator= (const arrayListType<elemType> &);
//Overloads the assignment operator
bool isEmpty () const;
bool isFull () const;
int listSize () const;
int maxListSize () const;
void print() const;
bool isItemAtEqual (int location, const elemType& item) const;
virtual void insertAt (int location, const elemType& insertItem)
virtual void insertEnd (const elemType& insertItem) = 0;
void removeAt (int location);
void retrieveAt (int location, elemType& retItem) const;
= 0;
virtual void replaceAt (int location, const elemType& repItem)
void clearList();
0;
%3D
virtual int seqSearch (const elemType& searchItem) const = 0;
virtual void remove (const elemType& removeItem) = 0;
arrayListType (int size = 100);
arrayListType (const arrayListType<elemType>& otherList);
virtual ~arrayListType ();
Transcribed Image Text:Write the definition of the class template ArrayListType, and the derived class unordered ArrayListType. Provide implementations for the non abstract functions in the base template class, and implementations of the template functions in the derived template class. Write a test program to test the functions in the derived template class. Instantiate objects of type derived class in your test program using template parameters of type float, int. You may use the example provided in the lecture slides. Many of the functions were implemented in the slides. Some were not implemented and you will have to implement them yourself in this lab. Below are the definitions of the base template class and the derived template class (from the lecture slides). template <class elemType> class arrayListType { public: const arrayListType<elemType> & operator= (const arrayListType<elemType> &); //Overloads the assignment operator bool isEmpty () const; bool isFull () const; int listSize () const; int maxListSize () const; void print() const; bool isItemAtEqual (int location, const elemType& item) const; virtual void insertAt (int location, const elemType& insertItem) virtual void insertEnd (const elemType& insertItem) = 0; void removeAt (int location); void retrieveAt (int location, elemType& retItem) const; = 0; virtual void replaceAt (int location, const elemType& repItem) void clearList(); 0; %3D virtual int seqSearch (const elemType& searchItem) const = 0; virtual void remove (const elemType& removeItem) = 0; arrayListType (int size = 100); arrayListType (const arrayListType<elemType>& otherList); virtual ~arrayListType ();
protected:
elemType *list; //array to hold the list elements
int length;
int maxSize;
//variable to store the length of the list
//variable to store the maximum
//size of the list
};
class unorderedArrayListType
template <class elemType>
class unorderedArrayListType: public arrayListType<elemType>
public:
void insertAt(int location, const elemType& insertItem);
void insertEnd (const elemType& insertItem);
void replaceAt (int location, const elemType& repItem);
int seqSearch(const elemType& searchItem) const;
void remove (const elemType& removeItem);
unorderedArrayListType (int size = 100);
//Constructor
};
Transcribed Image Text:protected: elemType *list; //array to hold the list elements int length; int maxSize; //variable to store the length of the list //variable to store the maximum //size of the list }; class unorderedArrayListType template <class elemType> class unorderedArrayListType: public arrayListType<elemType> public: void insertAt(int location, const elemType& insertItem); void insertEnd (const elemType& insertItem); void replaceAt (int location, const elemType& repItem); int seqSearch(const elemType& searchItem) const; void remove (const elemType& removeItem); unorderedArrayListType (int size = 100); //Constructor };
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 3 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY