Starting Out with C++: Early Objects (9th Edition)
Starting Out with C++: Early Objects (9th Edition)
9th Edition
ISBN: 9780134400242
Author: Tony Gaddis, Judy Walters, Godfrey Muganda
Publisher: PEARSON
bartleby

Concept explainers

Question
Book Icon
Chapter 15, Problem 6PC
Program Plan Intro

Removal of Line Breaks

Program Plan:

  • Include the required header files to the program.
  • Definition for filter class.
    • In public, declare the function for “do_Filter()”.
    • In protected, declare the function for “transform(char ch)”.
  • Include the required function prototypes.
  • Function definition of the function “do_Filter()”.
    • Declare the variable "letter" to get the character stored in the file.
    • Loop to check the end of file.
    • Output the characters to the file.
    • Get the character from the input file.
  • Derived class “Line_Break”.
    • In protected, define the “transform ()” function.
      • Inside the function return the value to the function.
    • In public, declare the “do_Filter ()” function.
  • Definition of “do_Filter ()” function.
    • Check the input file contains the line breaks.
      • If so, removal the line breaks and adds a space between the each word.
      • Otherwise, call the “transform ()” function.
    • Declare the “File_print()” function.
  • Define the main() function.
    • Declare the require variable to hold the input and output file.
    • Get the file name from the user.
    • Create an object for the input file.
    • Check the file open condition using “while” loop.
      • Exit the program for invalid filename.
    • Call the function “File_print()”.
    • Get the output file name from the user.
    • Create an object for the output file.
    • Check the file open condition using “while” loop.
      • Exit the program for invalid filename.
    • Creating an object for “Line_Break ()”.
    • Close output file.
    • Re open the file to print the content.
    • Close all files.
  • Function definition for the function “File_print()”.
    • Clear the content of the file.
    • Seek arbitrary position in the file.
    • Loop to check the end of file.
      • Print the character.
    • Clear the content of the file.
    • Seek arbitrary position in the file

Blurred answer
Students have asked these similar questions
Task 4. Utility classes   Implement a Menu-Driven program of ArrayList class using the above scenario and perform the following operations.                                                                                                                                                 Create an object of ArrayList class based on the scenario with explanations of the method Create a method that will allow inserting an element to ArrayList Class based on the scenario. The input field must be validated as Create a method to delete specific elements in the ArrayList with explanations of the method
CLASSES, DYNAMIC ARRAYS AND POINTERS   Define a class called textLines that will be used to store a list of lines of text (each line can be specified as a string). Use a dynamic array to store the list.  In addition, you should have a private data member that specifies the length of the list.  Create a constructor that takes a file name as parameter, and fills up the list with lines from the file.  Make sure that you set the dynamic array to expand large enough to hold all the lines from the file.  Also, create a constructor that takes an integer parameter that sets the size of an empty list. in C++   Write member functions to: remove and return the last line from the list add a new line onto the end of the list, if there is room for it, otherwise print a message and expand the array empty the entire list return the number of lines still on the list take two lists and return one combined list (with no duplicates) copy constructor to support deep copying remember the destructor!
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.

Chapter 15 Solutions

Starting Out with C++: Early 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
    EBK JAVA PROGRAMMING
    Computer Science
    ISBN:9781337671385
    Author:FARRELL
    Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT