How would i turn this into a template i have the idea but not fully sure ง D C dynamicArray.n 1 #ifndef DYNAMICARRAY_H 2 #define DYNAMICARRAY_H 3 #include 4 S 6 7 8 9 10 11 12 13 14 15 16 17 18 20 21 22222222222 using namespace std; class DynamicArray{ }; string* array; int currentMaxNumElements; int currentNumElementsStored; void resize(const int newsize); public: DynamicArray(); DynamicArray(string*, int, int); DynamicArray(const DynamicArray& rhs); ~DynamicArray(); DynamicArray& operator=(const DynamicArray& rhs); int getCurrentNumElementsStored () const; int getCurrentMaxNumElements() const; void addElementToEndOfArr(const string& newitem); string getElementAtIndex(const int i) const; void replaceElementAtIndex(int i, string newItem); void removeElementAtIndex(int i); void clearArray(); friend ofstream& operator<<(ofstream& out, DynamicArray arr); #include "dynamicArray.cpp" #endif
How would i turn this into a template i have the idea but not fully sure ง D C dynamicArray.n 1 #ifndef DYNAMICARRAY_H 2 #define DYNAMICARRAY_H 3 #include 4 S 6 7 8 9 10 11 12 13 14 15 16 17 18 20 21 22222222222 using namespace std; class DynamicArray{ }; string* array; int currentMaxNumElements; int currentNumElementsStored; void resize(const int newsize); public: DynamicArray(); DynamicArray(string*, int, int); DynamicArray(const DynamicArray& rhs); ~DynamicArray(); DynamicArray& operator=(const DynamicArray& rhs); int getCurrentNumElementsStored () const; int getCurrentMaxNumElements() const; void addElementToEndOfArr(const string& newitem); string getElementAtIndex(const int i) const; void replaceElementAtIndex(int i, string newItem); void removeElementAtIndex(int i); void clearArray(); friend ofstream& operator<<(ofstream& out, DynamicArray arr); #include "dynamicArray.cpp" #endif
Chapter1: An Introduction To Quickbooks Online
Section: Chapter Questions
Problem 3Q
Related questions
Question
I need do fast typing clear urjent no chatgpt used i will give 5 upvotes pls full explain ation
![How would i turn this into a template i
have the idea but not fully sure
ง
D
C
dynamicArray.n
1
#ifndef DYNAMICARRAY_H
2
#define DYNAMICARRAY_H
3
#include <iostream>
4
S
6
7
8
9
10
11
12
13
14
15
16
17
18
20
21
22222222222
using namespace std;
class DynamicArray{
};
string* array;
int currentMaxNumElements;
int currentNumElementsStored;
void resize(const int newsize);
public:
DynamicArray();
DynamicArray(string*, int, int);
DynamicArray(const DynamicArray& rhs);
~DynamicArray();
DynamicArray& operator=(const DynamicArray& rhs);
int getCurrentNumElementsStored () const;
int getCurrentMaxNumElements() const;
void addElementToEndOfArr(const string& newitem);
string getElementAtIndex(const int i) const;
void replaceElementAtIndex(int i, string newItem);
void removeElementAtIndex(int i);
void clearArray();
friend ofstream& operator<<(ofstream& out, DynamicArray arr);
#include "dynamicArray.cpp"
#endif](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Fbce5339d-585b-4f3b-ba4a-f78c01873a8b%2F1ee44458-3cff-4048-b3fe-a6ef65a7e21c%2Fyuivfat_processed.jpeg&w=3840&q=75)
Transcribed Image Text:How would i turn this into a template i
have the idea but not fully sure
ง
D
C
dynamicArray.n
1
#ifndef DYNAMICARRAY_H
2
#define DYNAMICARRAY_H
3
#include <iostream>
4
S
6
7
8
9
10
11
12
13
14
15
16
17
18
20
21
22222222222
using namespace std;
class DynamicArray{
};
string* array;
int currentMaxNumElements;
int currentNumElementsStored;
void resize(const int newsize);
public:
DynamicArray();
DynamicArray(string*, int, int);
DynamicArray(const DynamicArray& rhs);
~DynamicArray();
DynamicArray& operator=(const DynamicArray& rhs);
int getCurrentNumElementsStored () const;
int getCurrentMaxNumElements() const;
void addElementToEndOfArr(const string& newitem);
string getElementAtIndex(const int i) const;
void replaceElementAtIndex(int i, string newItem);
void removeElementAtIndex(int i);
void clearArray();
friend ofstream& operator<<(ofstream& out, DynamicArray arr);
#include "dynamicArray.cpp"
#endif
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Recommended textbooks for you
![Accounting Information Systems](https://www.bartleby.com/isbn_cover_images/9781337619202/9781337619202_smallCoverImage.gif)
Accounting Information Systems
Accounting
ISBN:
9781337619202
Author:
Hall, James A.
Publisher:
Cengage Learning,
![Cornerstones of Cost Management (Cornerstones Ser…](https://www.bartleby.com/isbn_cover_images/9781305970663/9781305970663_smallCoverImage.gif)
Cornerstones of Cost Management (Cornerstones Ser…
Accounting
ISBN:
9781305970663
Author:
Don R. Hansen, Maryanne M. Mowen
Publisher:
Cengage Learning
![Accounting Information Systems](https://www.bartleby.com/isbn_cover_images/9781337619202/9781337619202_smallCoverImage.gif)
Accounting Information Systems
Accounting
ISBN:
9781337619202
Author:
Hall, James A.
Publisher:
Cengage Learning,
![Cornerstones of Cost Management (Cornerstones Ser…](https://www.bartleby.com/isbn_cover_images/9781305970663/9781305970663_smallCoverImage.gif)
Cornerstones of Cost Management (Cornerstones Ser…
Accounting
ISBN:
9781305970663
Author:
Don R. Hansen, Maryanne M. Mowen
Publisher:
Cengage Learning