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

Create a c++ program implementing a class that represents “ASCII art” images and

ID: 3885010 • Letter: C

Question

Create a c++ program implementing a class that represents “ASCII art” images and operations on them, respresented as two-dimensional char arrays allocated on the heap (using the new keyword).

Create a new C++ source file named canvas.cpp that implements the Canvas class, so that canvas.cpp and the provided files compile into a program that runs with no failed tests.

"simulate" a 2D array by a 1D array of pointers to 1D arrays (see the figure in Canvas.h file).

During development, your program might segfault. Be sure your IDE will tell you if your program ended due to a failed test versus a segfault.

The main.cpp and canvas.h are provided, these files are not to be edited only used to impement canvas.cpp file to allocate the arrays.

Only use basic c++ statements: if/else, for loops, basic arrays, allocate arrays, pointers(using *, or arrow ->), reference and dereference(using ampersand: &) ,keywords: new and delete.

main.cpp file:

canvas.h file:

Explanation / Answer

#include #include #include #include "canvas.h" using namespace std; inline void _test(const char* expression, const char* file, int line) { cerr