Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started