Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need only one C++ function . It's C++ don't write any other language. Hello I need unzip function here is my zip function below.

I need only one C++ function . It's C++ don't write any other language.

Hello I need unzip function here is my zip function below. So I need the opposite function unzip.

Instructions:

The next tools you will build come in a pair, because one (zip) is a file compression tool, and

the other (unzip) is a file decompression tool.

The type of compression used here is a simple form of compression called run-length encoding (RLE). RLE is quite simple: when you encounter n characters of the same type in a row, the compression tool (zip) will turn that into the number n and a single instance of the character.

Thus, if we had a file with the following contents: 10a4b the tool or unzip image text in transcribedfunction would turn it (logically) into: aaaaaaaaaabbbb

So write the C++ unzip function that will turn 10a4b into aaaaaaaaaabbbb opposite of zip function. I'll make a txt file example like file.txt that will have 10a4b text once I will run your unzip function it will turn into aaaaaaaaaabbbb. I tested my zip function on terminal and it's working perfectly.

here is my zip function:

Full program with zip funcion with output

#include #include #include

using namespace std; string zip(const string & str) { int i = str.size(); string enc;

for (int j = 0; j 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

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

Step: 3

blur-text-image

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

Oracle Database 19c DBA By Examples Installation And Administration

Authors: Ravinder Gupta

1st Edition

B09FC7TQJ6, 979-8469226970

More Books

Students also viewed these Databases questions