Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Instructions: Write the definition of an EZArray class to the following specific

ID: 3646925 • Letter: I

Question

Instructions:
Write the definition of an EZArray class to the following specification:
1. An EZArray contains strings.
2. All arrays are dynamic (do not declare arrays, but pointers to strings).
3. A function allocates memory space to the array.
4. A function deallocates the memory space.
5. A function assigns the string value in its parameter to all cells of the array.
6. A function assigns the string value in its first parameter to the cell indexed by its second parameter. If the index is out of bounds, the function should return 1. If it is in bounds, the function should return 0.
7. A function returns the string value of the cell indexed by its parameter. If the index is out of bounds, the function should return NULL.
8. A function copies the array passed as the parameter to the array field. If the array field is the same size or larger, pad with "" strings and return 0. If the array field is smaller, copy what fits and return 1. If the array field is NULL, return 1.
9. Create your class with .h and .cpp files.
10. Write a main.cpp file with your main function to test your class thoroughly. Don't assume that this file will be used to grade your program.

The program should be just how i asked for.

Explanation / Answer

7. A function returns the string value of the cell indexed by its parameter. If the index is out of bounds, the function should return NULL.