Question: Write a C++ program that acts like a simple counting tool for collecting information from textual files of documents prepared for a simple word processing

Write a C++ program that acts like a simple counting tool for collecting information from textual files of documents prepared for a simple word processing software. An input file for the simple word processor includes three types of data, commented lines, command lines and general text of the document to be formatted. A command line is recognized by the "%' at the beginning of the line and followed by a formating command. The simple word processor software includes three commands only for formatting textual documents. These are "bold", "italic", and "regular", which would affect formatting the following text of the document. A commented line is recognized by "#" at the beginning of the line, and would be skipped by the word processor. The simple counting tool should collect data about the total number of lines read from the file, the number of commented lines, the number of command lines, and the number of bold, italic, and regular commands.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!