Help, C/C++ Programming

Assignment Help:
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.

scription

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.

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

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.

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.

e. Add a function for inserting a string into the array. Insertion is done by providing a start position and a string

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.

g. Add a function that searches the text for a pattern. Show all occurrences of a string.

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.

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:

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.

Related Discussions:- Help

When does a name clash occur in c++, A name clash happens when a name is de...

A name clash happens when a name is described in more than one place. For example, two dissimilar class libraries could give two different classes the similar name. If you try to u

Change to palindrome, A palindrome is a string that reads the same from bot...

A palindrome is a string that reads the same from both the ends. Given a string S convert it to a palindrome by doing character replacement. Your task is to convert S to palindrome

C++ and matlab, ">http://www.ee.nmt.edu/~erives/289_F12/EE289_Takehome_2.p...

">http://www.ee.nmt.edu/~erives/289_F12/EE289_Takehome_2.pdf http://www.ee.nmt.edu/~erives/289_F12/Takehome2_maze.GIF

Decode, Problem Description Smugglers are becoming very smart day by day. N...

Problem Description Smugglers are becoming very smart day by day. Now they have developed a new technique of sending their messages from one smuggler to another. In their new techn

Recursive function, Binomial coefficients are the numeric factors of the pr...

Binomial coefficients are the numeric factors of the products in a power of a binomial such as (x + y)n. For example, (x + y)2 = x2 + 2 x y + y2 has the coefficients 1 2 1. Binomia

What is the role of && operator in a program code, What is the role of && o...

What is the role of && operator in a program code? - && is also referred to as AND operator. - When this operator is used, all conditions specified should be TRUE before nex

KRPano, I am seeking an expert to create a 360 degree virtual tour in KRPan...

I am seeking an expert to create a 360 degree virtual tour in KRPano for use on PCs, tablets and smartphones. You will be given with panoramas in order to create an advanced KRPano

Need epos programmng and building, Project Description: I have a barber ...

Project Description: I have a barber salon I am seeking someone to build me software for my PARTNER PT6910 touch screen till system. This software must add multiple staff login

How to write a global inline function, How to write a global inline functio...

How to write a global inline function First, let's get away from member functions for a moment and consider a global function.  To make a request that this function be in line:

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd