Ask Question, Ask an Expert

+61-413 786 465

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

Assignmentquestion onegiving the following code snippet

Assignment Question One Giving the following code snippet. What kind of errors you will get and how can you correct it. A. public class HelloJava { public static void main(String args[]) { int x=10; int y=2; System.out.p ...

Assignment - haskell program for regular expression

Assignment - Haskell Program for Regular Expression Matching Your assignment is to modify the slowgrep.hs Haskell program presented in class and the online notes, according to the instructions below. You may carry out th ...

Extend the adworks applicationi add dialogs to allow the

Extend the AdWorks application I. Add Dialogs to allow the user to Add, Edit, Read and Delete a Customer and refresh the view accordingly. 1. The user should be able to select a specific customer from the DataGrid and cl ...

Assignment - horse race meetingthe assignment will assess

Assignment - Horse Race Meeting The Assignment will assess competencies for ICTPRG524 Develop high level object-oriented class specifications. Summary The assignment is to design the classes that are necessary for the ad ...

Assignment task -q1 a the fibonacci numbers are the numbers

Assignment Task - Q1. (a) The Fibonacci numbers are the numbers in the following integer sequence, called the Fibonacci sequence, and are characterised by the fact that every number after the first two is the sum of the ...

Structs and enumsoverviewin this task you will create a

Structs and Enums Overview In this task you will create a knight database to help Camelot keep track of all of their knights. Instructions Lets get started. 1. What the topic 5 videos, these will guide you through buildi ...

Assignment - proposal literature review research method1

Assignment - Proposal, Literature Review, Research Method 1. Abstract - Summary of the knowledge gap: problems of the existing research - Aim of the research, summary of what this project is to achieve - Summary of the a ...

Background informationthis assignment tests your

Background Information This assignment tests your understanding of and ability to apply the programming concepts we have covered throughout the unit. The concepts covered in the second half of the unit build upon the fun ...

Question - create a microsoft word macro using vba visual

Question - Create a Microsoft Word macro using VBA (Visual Basic for Applications). Name the macro "highlight." The macro should highlight every third line of text in a document. (Imagine creating highlighting that will ...

Task silly name testeroverviewcontrol flow allows us to

Task: Silly Name Tester Overview Control flow allows us to alter the order in which our programs execute. Building on our knowledge of variables, we can now use control flow to create programs that perform more than just ...

  • 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

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As