Starting Out with C++ from Control Structures to Objects, Student Value Edition (9th Edition)
Starting Out with C++ from Control Structures to Objects, Student Value Edition (9th Edition)
9th Edition
ISBN: 9780134443829
Author: Tony Gaddis
Publisher: PEARSON
bartleby

Concept explainers

bartleby

Videos

Textbook Question
Book Icon
Chapter 15, Problem 9PC

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 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 the following member function:

void doFilterfifstream &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 transformfehar 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
createDatabaseOfProfiles(String filename) This method creates and populates the database array with the profiles from the input file (profile.txt) filename parameter. Each profile includes a persons' name and two DNA sequences. 1. Reads the number of profiles from the input file AND create the database array to hold that number profiles. 2. Reads the profiles from the input file. 3. For each person in the file 1. creates a Profile object with the information from file (see input file format below). 2. insert the newly created profile into the next position in the database array (instance variable).
Assessment Description Honors Students: Complete this assignment according to the directions provided in the "Honors Addendum," located in Class Resources. This activity has multiple parts. All parts must be completed prior to documentation submission. Part 1: Reading and Writing Text Files. In this activity, you will learn how to read and write text files using non buffered and buffered File I/O classes, then learn how to parse a String into tokens using the String split() method, and finally, how to handle exceptions using various approaches. Part 2: Reading and Writing JSON Files. In this activity, you will learn how to read, write, and serialize JSON files to and from Java Objects. Refer to the instructions within "Activity 4 Guide" to complete the assignment. APA style is not required, but solid academic writing is expected. This assignment uses a rubric. Please review the rubric prior to beginning the assignment to become familiar with the expectations for successful…
The functionality of each file is described below:Class BankAccount This class has two instance variables:namebalanceCreate a constructor that takes two parameters to initialize the instance variables name and balance. The name must not be an empty string. The name also must not include any numbers or symbols. The balance must be zero or more to be used.If the name was an empty string a Value Error will be raised with the message “name cannot be empty”If the name contained numbers or symbols a Value Error will be raised with the message “name cannot include numbers or symbols”If the name was valid, it will be formatted properly and assigned to the instance variable. The valid name consists of alphabetical characters lowercase or upper case, may include space, underscore or hyphen.The name may consist of first, middle and last name.One way to validate the name is using Regular Expressions.Proper name format is the first character uppercase and the rest of the name lowercase character.…

Chapter 15 Solutions

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

Ch. 15.7 - Prob. 15.11CPCh. 15.7 - What will the following program display? #include...Ch. 15.7 - What will the following program display? #include...Ch. 15.7 - What will the following program display? #include...Ch. 15.7 - What will the following program display? #include...Ch. 15.8 - Does the following diagram depict multiple...Ch. 15.8 - Does the following diagram depict multiple...Ch. 15.8 - Examine the following classes. The table lists the...Ch. 15.8 - Examine the following class declarations: class...Ch. 15 - What is an is a relationship?Ch. 15 - A program uses two classes: Dog and Poodle. Which...Ch. 15 - How does base class access specification differ...Ch. 15 - What is the difference between a protected class...Ch. 15 - Can a derived class ever directly access the...Ch. 15 - Which constructor is called first, that of the...Ch. 15 - What is the difference between redefining a base...Ch. 15 - Prob. 8RQECh. 15 - What is an abstract base class?Ch. 15 - A program has a class Potato, which is derived...Ch. 15 - What base class is named in the line below?class...Ch. 15 - What derived class is named in the line below?...Ch. 15 - What is the class access specification of the base...Ch. 15 - What is the class access specification of the base...Ch. 15 - Protected members of a base class are like...Ch. 15 - Complete the table on the next page by filling in...Ch. 15 - Complete the table below by filling in private,...Ch. 15 - Complete the table below by filling in private,...Ch. 15 - A derived class inherits the ________ of its base...Ch. 15 - When both a base class and a derived class have...Ch. 15 - An overridden base class function may be called by...Ch. 15 - When a derived class redefines a function in a...Ch. 15 - A(n) __________ member function in a base class...Ch. 15 - ________ binding is when the compiler binds member...Ch. 15 - __________ binding is when a function call is...Ch. 15 - _________ is when member functions in a class...Ch. 15 - When a pointer to a base class is made to point to...Ch. 15 - A(n) __________ class cannot be instantiated.Ch. 15 - A(n) _______ function has no body, or definition,...Ch. 15 - A(n) _________ of inheritance is where one class...Ch. 15 - _______ is where a derived class has two or more...Ch. 15 - In multiple inheritance, the derived class should...Ch. 15 - Write the first line of the declaration for a...Ch. 15 - Write the first line of the declaration for a...Ch. 15 - Suppose a class named Tiger is derived from both...Ch. 15 - Write the declaration for class B. The classs...Ch. 15 - T F The base classs access specification affects...Ch. 15 - T F The base classs access specification affects...Ch. 15 - T F Private members of a private base class become...Ch. 15 - T F Public members of a private base class become...Ch. 15 - T F Protected members of a private base class...Ch. 15 - T F Public members of a protected base class...Ch. 15 - T F Private members of a protected base class...Ch. 15 - T F Protected members of a public base class...Ch. 15 - T F The base class constructor is called after the...Ch. 15 - T F The base class destructor is called after the...Ch. 15 - T F It isnt possible for a base class to have more...Ch. 15 - T F Arguments are passed to the base class...Ch. 15 - T F A member function of a derived class may not...Ch. 15 - Prob. 51RQECh. 15 - T F A base class may not be derived from another...Ch. 15 - class Car, public Vehicle { public: Car(); Car();...Ch. 15 - class Truck, public : Vehicle, protected {...Ch. 15 - class SnowMobile : Vehicle { protected: int...Ch. 15 - class Table : public Furniture { protected: int...Ch. 15 - class Tank : public Cylinder { private: int...Ch. 15 - class Three : public Two : public One { protected:...Ch. 15 - Employee and ProductionWorker Classes Design a...Ch. 15 - ShiftSupervisor Class In a particular factory, a...Ch. 15 - TeamLeader Class In a particular factory, a team...Ch. 15 - Prob. 4PCCh. 15 - Time Clock Design a class named TimeClock. The...Ch. 15 - Essay Class Design an Essay class that is derived...Ch. 15 - PersonData and CustoraerData Classes Design a...Ch. 15 - PreferredCustomer Class A retail store has a...Ch. 15 - File Filter A file filter reads an input file,...Ch. 15 - File Double-Spacer Create a derived class of the...Ch. 15 - Course Grades In a course, a teacher gives the...Ch. 15 - Ship. CruiseShip, and CargoShip Classes Design a...Ch. 15 - Pure Abstract Base Class Project Define a pure...Ch. 15 - Prob. 14PC

Additional Engineering Textbook Solutions

Find more solutions based on key concepts
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
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