Question: PLease Help! c++ code Write an abstract file filter class (Filter.h file) that defines a pure virtual function for transforming a character. Pure virtual function:
PLease Help! c++ code
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.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
