Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In C++. Write an abstract file filter class (Filter.h file) that defines a pure virtual function for transforming a character. Pure virtual function: a virtual

In C++. Write an abstract file filter class (Filter.h file) that defines a pure virtual function for transforming a character. Pure virtual function: a virtual member function that must be overridden in a derived class that has objects. The abstract base class contains at least one pure virtual function: virtual void function_name() = 0; The = 0 indicates a pure virtual function, and there must be no function definition in the base class. Create two (2) derived classes of the file filter. One class that performs encryption as explained below, and another that transforms a file to all upper case. Prompt the user to select from these choices (1) being to upper case and (2) being to encryption. The class should have the following member function: void doFilter(ifstream& in_stream, ofstream& out_stream);// Should be called to perform the filtering The member function for transforming a single character should have the prototype: char transform(char ch); The encryption filter class transform function will convert the ASCII value for encryption by adding five (5) to the value and convert to the character for output (this is the encryption key). The program will prompt for the input file name from a function, echo the original file contents from a function, and then prompt for the output file name from a function. It will prompt for 1 for upper case output, or 2 for encryption output (this can be in main). The program will write to the output file and display the output to the console window. The program will have separate open_inputFile and open_outputFile functions with error checking in each, and a separate display function. All functions associated with the filter object will be in the Filter.h file. Portions of the code are provided below as a guidelinethe file handling may be challenging. Use a test file as shown below (this file will be used to test your submission):

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

What Is A Database And How Do I Use It

Authors: Matt Anniss

1st Edition

1622750799, 978-1622750795

More Books

Students also viewed these Databases questions

Question

EXPLAIN the strategic importance of total rewards.

Answered: 1 week ago

Question

=+ What would it look like? Who should deliver it?

Answered: 1 week ago