Question: In the file fill.cpp , write a function using canvas, which is a 2 dimensional array declared to be ROWS by COLS, and the function

In the file fill.cpp, write a function using canvas, which is a 2 dimensional array declared to be ROWS by COLS, and the function prototype
void drawStripe(int width, Pixel canvas[][COLS],int nRows, int nCols);
that sets the diagonal of the canvas to BLACK
BLACK is a value of the enumeration type Pixel defined in fill.h and just like in Assignment ()/()#8.
The diagonal stripe has a width and the stripe is to precondition:
Office on the web Frame and corner of the canvas
- width ()/(({}^(3)0/))
- nRows ()/((/leq /)) ROWS
- nCols ()/((/leq /)) COLS
When setting the pixels to BLACK in drawStripe, the BLACK pixels must be within the boundaries of the nRows by nCols defined canvas.
The unittest_(f)ill.cpp has many test cases with expected output.
If you do not want debugging output, uncomment the ()/()#define NDEBUG in the unittest_(f)ill.cpp
See the next page for examples printed out when running test_(f)ill
{(: rows =7 columns =7 stripe width =1):}
{(: +------+):}
In the file fill.cpp , write a function using

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!