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
icon
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.

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: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.
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.
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
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

Blurred answer
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
Bartleby Expert
SEE SOLUTION
Knowledge Booster
File Input and Output Operations
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
Database System Concepts
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)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education