'C' program to implement 'Text Editor' with features like insertion, deletion #include #include #include int i,j,ch; char fn20,e,c. Simple Text Editor System is a simple mini C # language software program. Basically, in this application, users can create text documents easily. Also, the system allows users greater flexibility while editing text files or documents. Talking about the system, it is all about editing and creating text documents. This tutorial will teach you how to create a text editor in C# or Visual Basic. You should already know either C# or VB and know how to navigate VS 2012. The tutorial will be split in two parts: Part A will focus on design and Part B will focus on coding. This program is written in pure C programming language. The interface of the C program is just like Turbo C/C compiler like interface, and it also provides some dialog boxes same like the Turbo C/C compiler. It has menus just like C/C compiler, text formatting options and also provides options to change font color.
Assignment 1: Simple Text Editor using C programming in Linux
Environment
The goal of this assignment is to help you practice c programming. A tutorial on Linux
commands and c programming is given at the end of this assignment. Resources/examples of c programming is given in Moodle and further help will be given in the labs.
Deliverables: you are required to upload your c code in the assignment dropbox set in
Moodle. You are supposed to work with Linux gcc compiler and pico editor for compiling via the command line in the Linux terminal. In the beginning, you can use Dev C++ or Eclipse IDE - CodeBlocks since your Linux server is being setup. Note that c programming has a filename.c extension (not .cpp). You should make a directory called “Assignment_1” in your 'home' directory of you Linux server account. In this directory, you can have your c code and accompanying files. Note that the code in your Linux server will be graded in your lab from your presentation. ![]()
Description
In this assignment, you will have the opportunity to write a simple text processing program with all essential functions (open and save text documents, insert and delete text, search for words). A MENU will be used that will help users perform these operations. We assume that text read from a file is stored in an array until the file is saved. You are required to use the c programming language (not C++) and use the std library functions or write the function yourself that implements operations/features of a simple text editor. Note that all these functions will be implemented in one c program file. Programming Requirements
a. Write a C program to open and close a file given its name. Your program must
check whether or not the file exists. (10 points)
b. Winrar equivalent for mac. Add a function for reading an opened file into an array of characters. You may
assume the array is large enough to hold an entire file (e.g. 100,000 characters). (10 points)
c. Add a function for saving the text stored in an array to a file. Your program must
check whether or not the output file already exists, and if it does, your program must ask the user whether he/she wishes to overwrite the file. (10 points)
d. Extend your program to count the number of words and characters in the text file.
An algorithm for counting words is given in the textbook. (15 points)
e. Add a function for inserting a string into the array. Insertion is done by providing a
start position and a string (15 points)
f. Add a function for deleting strings from the array. Deletion is done by providing a
start position and the length of the string to be deleted. (15 points)
g. Add a function that searches the text for a pattern. Show all occurrences of a
string. (10 points)
h. Add a function to replace all occurrences of a string with a new string. Note that
this operation is a combination of search, delete, and insert operations. (15 points)
Once all the functions have been implemented, you should design a menu that is used for
informing users about selection. “Pico” text editor in Linux is a good example.
Extra Credit Problem (20 points):
i. Extend your program to allow all operations performed since the last save to be undone in the reverse order in which they were executed. For instance, a command ‘d 3 4’ which deleted the string “abcd” from position 3 is undone by a command ‘i 3 abcd’ which will insert the string “abcd” at position 3. You will need a stack to save the undo operations that may be performed.
Editedby Akshay nand
We will not do your work for you. The breakdown there is straightforward - what have you attempted so far? Wine update mac.
In this tutorial you will learn how to build a fully functional text editor similar to Microsoft WordPad. Before you begin, make sure you have covered the C# tutorials, as this tutorial uses basic C# knowledge. In particular, focus on: if statements, for, foreach and methods. The tutorial is available as a PDF, and can be downloaded below.
Text Editor Contents
ABOUT
PART B – CODING PAGE 9
Text Editor C ProgrammingDownloadsComments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |