********* HELP*********PLEASE*****8 Define a dynamic array class whose data memb
ID: 3752302 • Letter: #
Question
********* HELP*********PLEASE*****8
Define a dynamic array class whose data members are private.
class dynamicArray
{
public:
void show();
dynamicArray(int new_size = 8);
dynamicArray(const dynamicArray& new_array);
dynamicArray operator=(const dynamicArray& souce);
private
int *elts;
int size;
}
Define the default constructor, copy constructor, assignment operator, and show method
The elements of the array are the digits from 0 to 9.
Define a function the elements of two arrays. The function returns product of the array elements. If the product of two array elements is too big to fit in an array position then some of the product carries to the next higher position in the array. The function's prototype is
dynamicArray multiply(const dynamicArray& da1, const dynamicArray da2);
Explanation / Answer
//Hey. Here is your solution.
// If it helps, please do upvote. Thank You.
//code is tested with visual studio 2015
class dynamicArray
{
private:
int *elts;
int size;
public:
dynamicArray multiply(const dynamicArray& da1, const dynamicArray& da2)
{
// Please elaborate this functionality.
// Given information is ambigious and not sufficient.
// Privide sample input and output for clear picture
};
void show()
{
cout << " Elements of Array are - ";
for (int i = 1; i <= size; i++)
{
cout << elts[i]<<" ";
}
};
dynamicArray(int new_size = 8)
{
size = new_size;
};
dynamicArray(const dynamicArray& new_array)
{
size = new_array.size;
elts = new_array.elts;
};
dynamicArray operator=(const dynamicArray& source)
{
size = source.size;
elts = source.elts;
};
};
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.