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

Assignment instructionsexception handlingfirst create three

Assignment Instructions Exception Handling First, create three exception classes named NumberHighException, NumberLowException, and NumberNegativeException. Both NumberHighException and NumberLowException should be direc ...

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

Write a program where you create a class called bankaccount

Write a program where you create a class called BankAccount. The BankAccount class should contain a String to store the customer name and a double to store the account balance. The BankAccount class should have two const ...

Pennies for pay you are hired for a job and your employer

Pennies for Pay You are hired for a job and your employer agrees to pay you each day. Your pay rate will be one penny the first day and two pennies the second day, four pennies the third day and continuing to double each ...

Along with your name include your student id and discussion

? Along with your name, include your student ID# and discussion section at the top of your Assignment. ? There are eight problems; we will go over them in dicussion section after the due date. ? The textbook in this cont ...

Programming assignmentthis question has two parts a and

Programming Assignment This question has two parts (a) and (b): Develop a program to read in five exam-scores (in the range of 0-100) of a student in HIST220 class. (a) You program should compute and store in memory the ...

The concepts discussed in this section can also be applied

The concepts discussed in this section can also be applied to eliminate partially dead code. A definition of a variable is partial ly dead if the variable is live on some paths and not others. We can optimize the program ...

Suppose you have a class cbirdsuppose you have a class

Suppose you have a class CBird Suppose you have a class CBird, as follows, that you want to use as a base class for deriving a hierarchy of bird classes: class CBird { protected: int wingSpan; int eggSize; int airSpeed; ...

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

Assignmentwrite a program to converts temperatures between

Assignment Write a program to converts temperatures between Fahrenheit and Celsius. Your program should print a brief message describing what it does, and then prompt the user to enter "1" if they would like to convert a ...

  • 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