Using C++ Task 1. File Filter: A file filter reads an input file, transforms it
ID: 3689254 • Letter: U
Question
Using C++
Task 1. File Filter:
A file filter reads an input file, transforms it in some way, and writes the results to an output file. Write an abstract file filter class that defines a pure virtual function for transforming a character. Create one derived class that performs encryption, another that transforms a file to all uppercase, and another that creates an unchanged copy of the original file. The class should have the following member function:
void doFilter (ifstream &in, ofstream &out)
This function should be called to perform the actual filtering. The member function for transforming a single character should have the prototype:
char transform (char ch)
The encryption class should have a constructor that takes an integer as an argument and uses it as the encryption key.
Task 2. File Double-Spacer:
Create a derived class of the abstract filter class of problem 1 that double-spaces a file: that is, it inserts a blank line between any two lines of the file.
Explanation / Answer
// file filter program
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.