Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hi, i have included ArrayList.hpp, ArrayList.tpo, List.hpp and main.cpp. Can someone please work on ArrayList.tpp? i have mentioned To do on the code. please use

Hi, i have included ArrayList.hpp, ArrayList.tpo, List.hpp and main.cpp.
Can someone please work on ArrayList.tpp? i have mentioned "To do" on the code.
please use a compilet and share the results.
Thanks. image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
virtual void clear() override; I/ return the element at the given position (argument) virtual T getelement(int) const override; II return the current length of the list virtual int getlength() const override; I/ return the maximum size of the list int getMaxSize() const; Insert the given element (argument 2) at the given position (argument 1) virtual void insert(int, const T\&) override; I/ determine if the list currently empty virtual bool isEmpty() const override; // determine if the list currently full bool isfull() const; I/ remove the element at the given position (argument) virtual void remove(int) override; I/ replace the element at the given position (argument 1) I/ the value given (argument 2) virtual void replace(int, const T\&) override; I/ overloaded stream insertion operator to make printing template friend ostream\& operatore); clude "Arraylist.tpp" 39 40 41 42 // replace the element at the given position (argument 1) with 43 44 virtual void replace(int, const T\&) =0; 44 \#endif // create a second list using the copy constructor Arraylist secondList = myList; I/ modify the second list and display its state secondList. append("Beat"); secondList. replace(2, "Drums"); cout secondlist; // try removing an element as an invalid operation try \{ secondlist. remove(4); 3 catch (const string\& e) \{ cout eendl \} II create a third list using the default constructor (max size of 100) Arraylistestring> thirdlist; I/ display the state of the list, should be empty cout thirdlist; // copy the first list to the third list using assignment overload thirdlist = mylist; // display the length and max size, should match the first list. cout "thirdlist length: " thirdlist.getlength() endl; cout "thirdlist maximum size: " thirdList.getMaxsize() endl; // try getting an element as an invalid operation try \{ word = thirdlist. getelenent (9); 3 catch (const strings e) \{ cout e end If add elements to the list thirdlist. append("Be A"); thirdList . append ("Yellow")

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

Database Design And Relational Theory Normal Forms And All That Jazz

Authors: Chris Date

1st Edition

1449328016, 978-1449328016

Students also viewed these Databases questions