Question: DO THIS IN C++ //myArray.h #include class myArray { int size; int start; int end; int *data; public: myArray(int sz); myArray(int lower, int upper); int
DO THIS IN C++

//myArray.h
#include
class myArray { int size; int start; int end; int *data;
public: myArray(int sz); myArray(int lower, int upper); int & operator[](const int index); };
***********************************************************************
//myArray.cpp
#include
#include "myArray.h"
myArray::myArray(int sz) //constructor { size = sz; start = 0; end = sz - 1; data = new int[size]; for (int i = start; i
myArray::myArray(int lower, int upper) //constructor overloaded { size = upper - lower; start = lower;
end = upper - 1; data = new int[size]; for (int i = start; i
int & myArray::operator[](const int index) // operator { if (index >= start && index
int & elem = * (data + index); return elem; } else { std::cout
} }
***********************************************************************
//main.cpp
#include
#include "myArray.h"
using namespace std;
int main() { int testNum; cout > testNum; cout
system("pause"); return 0; }
Project Requirements The class in Module 4 Project A processes only int arrays. Redesign your class myArray using class templates so that the class can be used in any application that requires arrays to process data
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
