Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hi I need one C++ function that is missing on this code. I need Unzip Function. Unzip function is missing . Please complete Unzip function

image text in transcribedHi I need one C++ function that is missing on this code. I need Unzip Function. Unzip function is missing .

Please complete Unzip function So far I have Cat, Grep, Zip.. I need Unzip function

cmd running command

gcc

example

gcc function_1.cpp

// function_1.cpp

///////////////

//Function for CAT :

#include #include

using namespace std;

int main(int argc,char *argv[]) { ifstream in; // one argument if(argc

image text in transcribed

/////////////////////

// function2.cpp

////////////////////////////////

//FUNCTION FOR GREP

#include #include #include

using namespace std;

int main(int argc,char *argv[]) { ifstream in;

// one argument if(argc

string line; // read each line while(getline(in,line)){ // if string found in line if(line.find(argv[2])!=-1){ // print the line cout

// close file in.close();

return(0); }

image text in transcribed

////////////

// function3.cpp

////////////////////////

//FUNCTION FOR ZIP

#include #include #include #include

using namespace std;

// to encode string

string zip(string str) { // to store encode string string ret=""; // get length of string int len=str.length(); // read each character in a string for(int i=0;i>add; ret+=add; } } // return encoded string return(ret); }

int main(int argc,char *argv[]) {

ifstream in; // one argument if(argc

return(0);

}

Requirements wcat is passed in a file and will output the file on the terminal (use cat to familiarize yourself with how this should work) wgrep is passed 2 arguments, the first is the word or words that the user is looking for and the second argument is the file that should be searched (use grep to familiarize yourself with this) wzip is passed a text file and redirects it to a compressed zip file wunzip is passed a zip file and prints out the unzipped file in standard output E:\programc++>function_1 cat testAli.txt This is test for all. adadddddd adadadddd All I have and all line go and I hope they are working solid test it iss E:\programc++> E:\programc++>function2 grep is testall.txt This is test for all. solid test it is E:\programc++>

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

Microsoft SQL Server 2012 Unleashed

Authors: Ray Rankins, Paul Bertucci

1st Edition

0133408507, 9780133408508

More Books

Students also viewed these Databases questions

Question

9. System creates a large, diverse talent pool.

Answered: 1 week ago