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

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

Programming computer science assignmmentprogramming1

Programming Computer Science Assignmment Programming 1) Explain the difference between an event and an event handler. Provide at least two examples of an event. 2) Explain how an animation uses still images and loops to ...

Program 1write a program that reads and processes data

Program 1 Write a program that reads and processes data about quarterly rainfall for one year. Your program should ask the user to enter rain fall amounts for each of the four quarters in the year. You must use a looping ...

Lab- forms loops and stringssubmission Lab- Forms, Loops and Strings Submission

Lab- Forms, Loops and Strings Submission Instructions How Please submit your lab report to the Lab4_Submission folder in Moodle. When Labs are due in 1 week on Feb. 13, 2014 Exercises: Goals: - Gain more hands-on with us ...

Using the machine model find the minimum initiation

Using the machine model, find the minimum initiation interval and a uniform schedule for the iterations, for the following loop: for(i =1; i A[i] = B[i-1] + 1; B[i] = A[i-1] +2; } Remember that the counting of iterations ...

Program assignment multi-threaded programming in java

Program Assignment: Multi-threaded Programming in Java Using Locks Objectives: To practice programming cooperating, synchronized multiple threads of execution. Description: In this programming assignment you will simulat ...

Create a very basic calculator map out the numeric keypad

Create a very basic calculator, map out the numeric keypad (17 buttons) and an EditText view. If text is given, prompt the user with a message that complains about the error. Toast.makeToast(getApplicationContext() , "er ...

Create a base class that will include the properties of

Create a base class that will include the properties of some type of data related to the company you work for or a favorite hobby. For example, I work for a healthcare provider, so my base class might be "Medical Facilit ...

Assignmentafter informing the user what the program does

Assignment After informing the user what the program does, prompt the user for the number of darts to throw. Also, prompt for a number of simulations (why not have the program simulate this dart throwing more than once). ...

Assignmentthe fourth programming project involves writing a

Assignment The fourth programming project involves writing a program to manage a student database. The interface to the program should be a GUI that looks similar to the following: A combo box should allow the user to se ...

  • 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

WalMart Identification of theory and critical discussion

Drawing on the prescribed text and/or relevant academic literature, produce a paper which discusses the nature of group

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