Starting Out with C++: Early Objects
Starting Out with C++: Early Objects
8th Edition
ISBN: 9780133360929
Author: Tony Gaddis, Judy Walters, Godfrey Muganda
Publisher: Addison-Wesley
bartleby

Concept explainers

bartleby

Videos

Textbook Question
Book Icon
Chapter 15, Problem 5PC

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 subclass of your file filter 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 a member function

void doFilter(ifstream &in, ofstream &out)

that is 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.

Blurred answer
Students have asked these similar questions
In C++ code: Design and write a C++ class that reads text, binary and csv files.  The class functions: Size:      Returns the file sizeName:      Returns the file nameRaw:    Returns the unparsed raw dataParse:    A external function to Parse the data.  The function accepts the raw data and returns the data parsed by the function.  This type of function is called a "Call-Back Function". A Call-Back is necessary for each file as each file requires different regular expressions to parse.   Call-back.cpp #include <string>#include <functional>#include <iostream>#include <vector>using namespace std; string ToLower(string s){    string temp;    for (char c : s)        temp.push_back(tolower(c));    temp.push_back(NULL);    return temp;} string ToUpper(string s){    string temp;    for (char c : s)        temp.push_back(toupper(c));    temp.push_back(NULL);    return temp;} struct Append{    string operator()(string a, string b)  // function object    {        return a…
Computer Science JAVASCRIPT .xlsx parser I need to write a public class that reads an .xlsx file and returns an array of data in javascript. The array would be all of the data inside of the file. The file itself is going to be inside of a folder(downloadedFIles) inside of my project. So the public class will need to account for that.
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 subclass of your file filter 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 a member function void doFilter(ifstream &in, ofstream &out)that is called to perform the actual filtering. The member function for transforming a single character should have the prototypechar transform(char ch)The encryption class should have a constructor that takes an integer as an argument and uses it as the encrytion key.

Chapter 15 Solutions

Starting Out with C++: Early Objects

Additional Engineering Textbook Solutions

Find more solutions based on key concepts
The ____________ is always transparent.

Web Development and Design Foundations with HTML5 (8th Edition)

template class T T square(T number) { return T T; }

Starting Out with C++ from Control Structures to Objects (9th Edition)

Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Text book image
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Introduction to Classes and Objects - Part 1 (Data Structures & Algorithms #3); Author: CS Dojo;https://www.youtube.com/watch?v=8yjkWGRlUmY;License: Standard YouTube License, CC-BY