MyLab Programming with Pearson eText -- Standalone Access Card -- for Starting Out With C++: Early Objects (My Programming Lab)
MyLab Programming with Pearson eText -- Standalone Access Card -- for Starting Out With C++: Early Objects (My Programming Lab)
9th Edition
ISBN: 9780134379548
Author: Tony Gaddis, Judy Walters, Godfrey Muganda
Publisher: PEARSON
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
Write a class Employee with data members Name, Id, and Salary. Derive two classes, Faculty with data members Department, and role(permanent or visiting) and derived class Management with data members Department and rank (manager, deputymanager, etc.). Create getters,settersfor all thedata members, create constructors,destructorsand show functionsfor all the classes.Create a write function to writeemployees on a file.In main function createtwo objectsof each derived classusing parameterized constructors, call the show function to show all four objects, write all four objects to a file. Your submission should include the output file.
array of Payroll ObjectsDesign a PayRoll class that has data members for an employee’shourly pay rate and number of hours worked. Write a program withan array of seven PayRoll objects. The program should read thenumber of hours each employee worked and their hourly pay ratefrom a file and call class functions to store this information in theappropriate objects. It should then call a class function, once foreach object, to return the employee’s gross pay, so this informationcan be displayed.
using C++ 1- Creates a class called Member with two integer x and y.a. Add a constructor able to create a Member object with tow integers and the default values 0,0.b. Add the methods setX and setY to modify the attributes x and y; [2 Markc. Add the method display able to display the attributes. 2- A Stack is a special array where the insertion and deletion will be via a specific index called "head". A Stack is characterized by 3 attributes:a. capacity (int): the maximum number element Member that can be contained into the Stack.b. head: presents the index where we can add/remove element to the Stack. The head value presents also the current number of elements into the Stack. When a Stack is created the initial value of head is 0.c. Member content[]: an array of elements of type Member. Creates the class Stack with the following methods:a. bool empty(): this method returns true if no element exists in the Stack. b. bool full(): this method returns true if there are no place to add a…

Chapter 15 Solutions

MyLab Programming with Pearson eText -- Standalone Access Card -- for Starting Out With C++: Early Objects (My Programming Lab)

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++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
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