Hello everyone
I've got an assignment to do and I need help from you my friends if anyone can
The task is as follows:
This assignment requires you to write a simple text editor. Your editor will have the following commands:
e filename: edits the filename if it exists
If it doesn’t exist, then you’ll be creating a new file.
i: (insert mode) insert any number of lines after current line.
Ctrl- v: stop inserting data (turn off insert mode)
l: list the entire file without line numbers
n: list the entire file with line numbers
d n: delete the number n
c: count the numbr of lines in the file
s: save the file opened with the e command
p: print the file
q: quit the program prompting for save if the file has not been saved
Once your program begins, a prompt must appear on the screen. Commands can be entered following the prompt. A sample run of program is shown below:
> e welcome.cpp
> i
#include <iostream>
using namespace std;
void main ()
{
cout<<”Welcome to Etisalat College”<<endl;
}
^V
1) #include <iostream>
2) using namespace std;
3) void main ()
4) {
5) cout<<”Welcome to Etisalat College”<<endl;
6) }
> c
welcome.cpp has 6 lines
> s
saved welcome.cpp
> p
printing welcome.cpp
> q
ThanX very much in advance
I'd be glad if anyone can include the documentation or the comments in the important steps.
ThanX again
