Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please help me with these ERRORS in this C++ code. UnorderedArrayList.h, is where the declaration of public functions. from the header file (header file not
Please help me with these "ERRORS" in this C++ code.
UnorderedArrayList.h, is where the declaration of public functions. from the header file (header file not posted here).
UorderedArrayList.cpp, is the definition of public functions from UnorderedArrayList.h. I have errors here.
Errors below:
I'm not supposed to add/modify any public methods from UnorderedArrayList.h, but how do I fix these errors without losing the idea of this code. Please provide explanation so I will learn. Thank you.
\#ifndef UNORD_ARRLIST_H \#define UNORD_ARRLIST_H \#include "AbstractList.h" class UnorderedArrayList : public AbstractList private: int* array; int capacity; int currentPos; public: UnorderedArraylist(); UnorderedArrayList(int initialCapacity); virtual bool add(int data); virtual bool add(int index, int data); virtual void clear(); virtual bool contains(int data); virtual int get(int index); virtual int indexOf(int data); virtual bool isEmpty(); virtual int remove(int index); virtual bool removeAll(int data); virtual int size(); virtual void trimToSize() ; \}; \#endif Compilation failed due to following error(s). numElements UnorderedArrayList.cpp: At global scope: UnorderedArrayList. cpp:54:1: error: 'Object' does not name a type 54 | Object UnorderedArraylist: :remove() \{
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started