Question: Lab 4 Question: Create an Array class according to the UML. UML: - data: int * - size: int + Constructor: constructor with parameters +
Lab
Question: Create an Array class according to the UML.
UML:
data: int
size: int
Constructor: constructor with parameters
Copy constructor:
Destructor:
Then, create a new class: ArrayNew. Use unique pointer to replay the raw pointer you used before.
TA explanation:
You need to create files. files for h and for cpp h and cpp for Array and h and cpp for ArrayNewYou need to use a normal pointer in the Array class and a unique pointer for ArrayNew class. Dont connect the array class and ArrayNew class. Both are separate and have different pointers. Array class has normal raw pointer and ArrayNew class has unique pointer You need to define a parametrized constructor, copy constructor and a destructor.
Despite all the instructions, I still have no idea what to do and what they are asking for. The TA said to use a for loop to iterate through the array. That, however is about all I understand. Please help me understand this and walk me through what to do Including code is extremely helpful as long as I understand it
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
