Ask Question, Ask an Expert

+1-415-315-9853

info@mywordsolution.com

Ask Programming Language Expert

Assignment: Simple Text Editor using C programming in Linux Environment

The main goal of this assignment is to assist you practice in c programming. A tutorial on Linux commands and c programming is given at the end of assignment.

Resources or illustrations of c programming are given in Moodle.

Description:

In this assignment, you will encompass the opportunity to prepare a simple text processing program with all the essential functions (open and save text documents, insert and delete text and search for words). A MENU will be employed that will help users perform such operations. We suppose that text read from a file is stored in an array till the file is saved.

You are needed to employ the c programming language (not C++) and employ the std library functions or prepare the function yourself which implements operations or features of a simple text editor.

Note that all such functions will be implemented in one c program file.

Programming Requirements:

1) prepare a C program to open and close a file given its name. Your program should check whether or not the file exists.

2) Add up a function for reading an opened file into an array of characters. You might suppose the array is large adequate to hold a whole file (ex:  100,000 characters).

3) Add up a function for saving the text stored in an array to a file. Your program should check whether or not the output file already exists, and if it does your program should ask the user whether he or she wishes to overprepare the file.

4) Extend your program to count the number of words and characters in the text file. An algorithm for counting words which is given in the textbook.

5) Add up a function for inserting a string into the array. Insertion is done through providing a start position and a string.

6) Add up a function for deleting strings from the array. Deletion is done by providing a start position and the length of string to be deleted.

7) Add up a function which searches the text for a pattern. Show all the occurrences of a string.

8) Add up a function to substitute all the occurrences of a string with a new string. Note that this operation is a combination of search, delete and insert operations.

Once all the functions have been implemented, you must design a menu which is used for informing users about selection. “Pico” text editor in Linux is a good illustration.

Additional Problem:

Extend your program to permit all operations performed as the last save to be undone in the reverse order in which they were executed. For illustration, 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 require a stack to save the undo operations that might be performed.

Programming Language, Programming

  • Category:- Programming Language
  • Reference No.:- M9585

Have any Question? 


Related Questions in Programming Language

The program will store the realty listings data as a

The program will store the realty listings data as a dynamically allocated LINKED LIST, instead of an array of records. The program will allow the realtors to both maintain and use the listings data. 1. Again, begin the ...

Assignmentwrite a program that calculates the intersection

Assignment Write a program that calculates the intersection of two sets of numbers. The sets can be represented using arrays. The general idea is that A!=0 if i is in the set and A==0 if it is not. Array element A can th ...

The air pollution level of a city on a given day is a

The air pollution level of a city on a given day is a function of the time of day (in hours). As an environmental specialist, you have collected carbon dioxide level readings at different times. An example of one day of ...

Write a program that will help an elementary school student

Write a program that will help an elementary school student learn multiplication. Use rand to produce two positive one-digit integers. It should then type a question such as: How much is 6 times 7? The student then types ...

Now consider the outer loop of given figure consisting of

Now consider the outer loop of given figure, consisting of blocks B2, B3, B4, and B5. Let g be the transfer function for the loop body, from the entry of the loop at B2 to its exit at B5. Let i measure the number of iter ...

Assignmentcollege maintains a file of credit hours

Assignment College maintains a file of credit hours completed for their students, named CREDITS.TXT. Each line of the file contains: • the student's ID number (an 8-character string, containing 2 letters followed by 6 di ...

Assignmenthomework assignments must be individuals original

Assignment Homework assignments must be individual's original work. Discussion without taking notes will be fine, but collaborations will not be tolerated. Dishonesty will result in an automatic F grade and a formal char ...

Wite a method to computer the following series mi 12 23

Write a method to computer the following series: m(i) = 1/2 + 2/3 + . . . + i/i + 1 Write a test program that displays the following table: I m(i) 1 0.5000 2 1.1667 . . . 19 16.4023 20 17.3546 Formulas to achieve the abo ...

Assignment research projectwrite an overview of any two of

Assignment: Research Project Write an overview of *any two* of the below topics. Each overview should be between one half and one full page long. You should use a minimum of two sources for each overview; make sure to re ...

Handling exceptions in the guestbook applicationgeneral

Handling Exceptions in the Guestbook Application General guideline In this project, you will need to implement exception handling mechanism in the Guestbook application created in Lab. The code I provide to you does not ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Section onea in an atwood machine suppose two objects of

SECTION ONE (a) In an Atwood Machine, suppose two objects of unequal mass are hung vertically over a frictionless

Part 1you work in hr for a company that operates a factory

Part 1: You work in HR for a company that operates a factory manufacturing fiberglass. There are several hundred empl

Details on advanced accounting paperthis paper is intended

DETAILS ON ADVANCED ACCOUNTING PAPER This paper is intended for students to apply the theoretical knowledge around ac

Create a provider database and related reports and queries

Create a provider database and related reports and queries to capture contact information for potential PC component pro

Describe what you learned about the impact of economic

Describe what you learned about the impact of economic, social, and demographic trends affecting the US labor environmen