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

Accounting Information Systems
10th Edition
ISBN:9781337619202
Author:Hall, James A.
Publisher:Hall, James A.
Chapter2: Introduction To Transaction Processing
Section: Chapter Questions
Problem 6MCQ
icon
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
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
steps

Step by step

Solved in 2 steps

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Accounting Information Systems
Accounting Information Systems
Accounting
ISBN:
9781337619202
Author:
Hall, James A.
Publisher:
Cengage Learning,
Cornerstones of Cost Management (Cornerstones Ser…
Cornerstones of Cost Management (Cornerstones Ser…
Accounting
ISBN:
9781305970663
Author:
Don R. Hansen, Maryanne M. Mowen
Publisher:
Cengage Learning
Quickbooks Online Accounting
Quickbooks Online Accounting
Accounting
ISBN:
9780357391693
Author:
Owen
Publisher:
Cengage