Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I asked this question previously on chegg and I'm not understanding the code to much, I'm suppose to accomplish this homework recursively. Could you please

image text in transcribed

I asked this question previously on chegg and I'm not understanding the code to much, I'm suppose to accomplish this homework "recursively." Could you please add comments and the missing declaration for identifies for this to work cause it also had a few errors. Thanks! //**********Code below***************

#include #include

void fill(){ while(true){ cin>>symbol; if(symbol=='E'){ cout>filename; std::ifstream infile(filename,std::ofstream::binary); std::ofstream outfile ("temp.txt",std::ofstream::binary); outfile.open ("test.txt"); cout>x; cout>y; cout>symbol; string line; while (std::getline(infile, line)){ if(x==0) break; outfile.write(line,line.length()); x--; } if(x==0 and line.length()>0){ line[y-1]=symbol; outfile.write(line,line.length()); while (std::getline(infile, line)){ outfile.write(line,line.length()); } } else{ while(x>0){ outfile.write(" ",1); } line=''; for(int i=0;i

int main(){ return 0; }

Your job is to write the fill function for a raster-based graphics symbols. The input to the function is the row and column cell of the pixel (symbol) to be changed and what symbol to change it to. The goal is to fill the enclosed shape (of one symbol) with the new symbol. This should be done recursively program. The graphic is stored in a 2D array of D-D-??? The program should dynamically read in an ascii art file, then prompt the user for the cell to fill and what symbol to fill it with. Then allow the user to save the new art Example run: Select from the options: (L) oad art F) ill. (S) ave art Choice? L File to read art.txt Ceeee oSS$$SSS$$$$ ~"SSSSSS"~ .@@@@> Cooee

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Pro SQL Server Wait Statistics

Authors: Enrico Van De Laar

1st Edition

1484211391, 9781484211397

More Books

Students also viewed these Databases questions