Answered step by step
Verified Expert Solution
Question
1 Approved Answer
C++ inheritance and polymorphism 1- Implement an abstract class Arrays that has the following pure virtual functions typel), that returns the type of the array
C++ inheritance and polymorphism
1- Implement an abstract class Arrays that has the following pure virtual functions typel), that returns the type of the array (1-dimensional or 2-dimensional). i) sie0, that returns the number of elements in the array (e.g. (4,6) if we have a 2 dimensional array of size 4 by 6). Part A Implement the subclass onebimension for one-dimensional arrays. It must have one data member: a pointer to an array of integers Besides implementing the methods typel) and size() defined in the base class, you have to write code for the following functions a- A constructor that takes zero or one parameter (i.e. the length of the array The default size may be set to 5) b- A destructor that simply deletes the array C-number0Elements(): returns the number of elements stored so far in the array d- Insert): method to add an element into the array in case it is not full e- Search0): method to search for an element and returns the position of that element in case it was found f- Max): returns the maximum value in the arrayStep 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