Question
Extend your lab to draw a picture of your choice to the canvas using ascii characters. To complete this task create a function called DrawPicture
Extend your lab to draw a picture of your choice to the canvas using ascii characters. To complete this task create a function called DrawPicture to draw a picture of your choice to the canvas. It should be called in between your calls to ClearCanvas and FrameCanvas. The picture must fit in the canvas frame and can be of anything you want. For my example, I made a stick figure selfie. You may use this same picture. Requirements 1. All requirements from the lab apply to the homework. 2. Your picture should resemble something or be a pattern. A couple of random characters dont count. Google search for ascii art for ideas. It is also permissible to use my example. 3. The picture should be within the boundaries of your frame. 4. Use good code style guidelines
Expected Output
********************
* *
* *
* *
* O *
* -|- *
* / \ *
* *
* *
********************
here is the code that doesnt have the picture
#include
void clearCanvas(char canvas[10][20]) { for(int i=0;i<10;i++) for(int j=0;j<20;j++) canvas[i][j] =' '; } void FrameCanvas(char canvas[10][20]) { for(int i=0;i<10;i++) for(int j=0;j<20;j++) { if(i==0 || i==9) canvas[i][j] ='*'; else if(j==0 || j==19) canvas[i][j] ='*'; } }
void DisplayCanvas(char canvas [10][20]) { for(int i=0;i<10;i++) { for(int j=0;j<20;j++) { cout << canvas[i][j]; } cout <
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