While implementing the search and replace functionality, you ma
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
100%
The code should be in C++, the hints for this are...
1. To search for a word in a line of text, you may use the find() function that
works with C++ string objects.
2. While implementing the search and replace functionality, you may need to make
a temporary copy of the text file.

Transcribed Image Text:In this project, you are tasked with developing a console-based text-editor. The required
functionalities for your text-editor are as follows:
1. View contents of the user-specified text file.
2. Create a new text file.
3. Write text to the user-specified text file.
4. Add/append text to the user-specified text file.
5. Search for a word in the user-specified text file and display ALL locations (the
line numbers) where the word appears.
6. Replace ALL occurrences of an existing word with another word in the user-
specified text file.

Transcribed Image Text:At the start of your program, it should display a menu listing possible choices for the
user which should highlight various features of your text-editor. Depending on the user's
choice, your program should run the appropriate task and display appropriate messages.
Once the task is complete, your program must return to the main menu. In case of an
error, your program must gracefully handle the error (for instance, if the specified text
file does not exist, your program should display an appropriate error message and return
to the main menu).
You are NOT required to use any graphical elements in your program.
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 3 steps

Follow-up Questions
Read through expert solutions to related follow-up questions below.
Follow-up Question
So, there is a infinite loop after needing to press ctrl+z and enter after adding text to the file, and when I do the append text, the ctrl+z+enter doesn't work, this also blocks me from searching for a word and replacing words.
Solution
Knowledge Booster
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.Recommended textbooks for you

Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON

Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education