Please write the code in java language Write a simple line o

  Please write the code in java language!  Write a simple line oriented text \"editor.\"  For each line the user should enter a line number (integer) and a string of text.  Create a data stucture which keeps these lines of text in order by line number (I would suggest a linked list where each list element has in int instance variable for line number, and a String instance variable for the text. If a new line is entered with the same line number, the previous text should be replaced by the new text.  If a line number is entered with no text, the line number should be deleted.  If the user enters LIST alone on a line,  the \"editor\" should print out each line, with associated line number, in order by line number.  If the user enters RESEQUENCE alone on a line, the line numbers should be resequenced to start at 10 and increment by 10.  Thus, if the user enters  5 Now is the time 15 To come to the aid 7 For all good people 35 Of their party  LIST  the program should print  5 Now is the time 7 For all good people 15 To come to the aid 35 Of their party  Typing  RESEQUENCE LIST  should give  10 Now is the time 20 For all good people 30 To come to the aid 40 Of their party 

Solution

Please find the required program along with its output. Please see the comments against each line to understand the step.

---------------------------------------------

OUTPUT:

Start entering :
5 Now is the time
15 To come to the aid
7 For all good people
35 Of their party
LIST
5 Now is the time
7 For all good people
15 To come to the aid
35 Of their party
RESEQUENCE
LIST
10 Now is the time
20 For all good people
30 To come to the aid
40 Of their party
20
LIST
10 Now is the time
30 To come to the aid
40 Of their party

 Please write the code in java language! Write a simple line oriented text \

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site