Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

ARRAYHELPER CLASS TEMPLATE Create a class specification (ArrayHelper.h) & class implementation (ArrayHelper.cpp) file for a class template named ArrayHelper The purpose of the ArrayHelper template

image text in transcribed

ARRAYHELPER CLASS TEMPLATE Create a class specification (ArrayHelper.h) & class implementation (ArrayHelper.cpp) file for a class template named ArrayHelper The purpose of the ArrayHelper template class is to perform common array functions on any numerical data type. ArrayHelper should have the following attributes: A pointer to an array of the template type An integer containing the number of elements in the array ArrayHelper should have the following member functions: Constructor, which accepts a pointer to an array and an integer containing the number of elements in the array. The constructor should set the number of elements attribute to the number sent to this function. Then, the constructor should create a NEW array of the same size and then copy the array elements from the array parameter into the ArrayHelper object's array. Destructor- should release the dynamically allocated array getMax function -should find the largest number in the array and return the integer index of the element that contains the largest number. getMin function-should find the smallest number in the array and return the integer index of the element that contains the smallest number. getTotal function- should find the total of all the elements and return the total getAvg function-should find the average of all the elements (hint: you can call the getTotal function!)

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

Excel 2024 In 7 Days

Authors: Alan Dinkins

1st Edition

B0CJ3X98XK, 979-8861224000

More Books

Students also viewed these Databases questions

Question

2. Develop a good and lasting relationship

Answered: 1 week ago