i cant get the logic of this task, help

i know this is homework but i cant get this thing straight, even minor help would be appreciated i did the others but this was too hard so have to ask for help...


Write a simple line editor. The line editor supports maximum of 150 characters per line and in total 300 lines. Start the program with EDIT fileName after which the prompt appears along
with the line number. If the letter I is entered with a number n following it, then insert the text to
be followed before line n. if I is not followed by a number, then insert the text before the current line. It D is entered with two numbers n and m, one n, or no number following it, then delete lines n through m, line n, or the current line. Do the same with the command L, which stands for
listing/printing lines. Entry E signifies exit and saving the text in a file. Here is a example,

EDIT testfile

1>
2> 3> 4> 3> 4> 5> 1> 2> 3> 4> 5> 5> 4> 1> 2> 3> 4> 4>

The first line

And another line
I3
The second line
One more line
L
The first line

The second line
One more line
And another line
D2
L
The first line
The second line
One more line
And another line
E













// this is now line 5, not 3
// Line 5, since L was issued from line 5
// line 4, since one line was deleted

// the and the following lines
// now have new numbers
Have you written any code?

If not, write comments which describe the methodology. This can be done incrementally, so start with a few really general ones, then go back and put in more detail. Keep doing this until you are ready to write code.

If you have code already, then post it.

HTH
the problem is i dont even know where to start here...
So what data types do you need to do this?
character array
uhm uhm >_< help? this is my first year and the deadline is too short...
Last edited on
nust?
Topic archived. No new replies allowed.