Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ here is the code: #include #include #include using namespace std; class Encryption { protected: ifstream inFile; ofstream outFile; public: Encryption(char *inFileName, char *outFileName); ~Encryption();

C++

image text in transcribed

here is the code:

image text in transcribed

image text in transcribed

#include #include #include using namespace std;

class Encryption { protected: ifstream inFile; ofstream outFile; public: Encryption(char *inFileName, char *outFileName); ~Encryption(); virtual char transform(char ch) const = 0; void encrypt();

};

Encryption::Encryption(char *inFileName, char *outFileName) { inFile.open(inFileName); outFile.open(outFileName); if (!inFile) { cout

void Encryption::encrypt() { char ch; char transCh; inFile.get(ch); while (!inFile.fail()) { transCh = transform(ch); outFile.put(transCh); inFile.get(ch); } }

class SimpleEncryption : public Encryption { public: char transform(char ch) const { return ch+1; } SimpleEncryption(char *inFileName, char *outFileName) : Encryption(inFileName, outFileName) { } };

int main() { char inFileName[80], outFileName[80]; cout > inFileName; cout > outFileName; SimpleEncryption obfuscate(inFileName, outFileName); obfuscate.encrypt(); return 0; }

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

Database Administrator Limited Edition

Authors: Martif Way

1st Edition

B0CGG89N8Z

More Books

Students also viewed these Databases questions

Question

Find the second derivative for each of the functions in Problem.

Answered: 1 week ago