1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
lukranit [14]
3 years ago
12

Your program will be a line editor. A line editor is an editor where all operations are performed by entering commands at the co

mmand line. Commands include displaying lines, inserting text, editing lines, cutting and pasting text, loading and saving files. For example, a session where the user enters three lines of text and saves them as a new file may appear as:
Engineering
1 answer:
soldier1979 [14.2K]3 years ago
7 0

Answer:

Java program given below

Explanation:

import java.util.*;

import java.io.*;

public class Lineeditor

{

private static Node head;

 

class Node

{

 int data;

 Node next;

 public Node()

 {data = 0; next = null;}

 public Node(int x, Node n)

 {data = x; next =n;}

}

 

public void Displaylist(Node q)

 {if (q != null)

       {  

        System.out.println(q.data);

         Displaylist(q.next);

       }

 }

 

public void Buildlist()

  {Node q = new Node(0,null);

       head = q;

       String oneLine;

       try{BufferedReader indata = new

                 BufferedReader(new InputStreamReader(System.in)); // read data from terminals

                       System.out.println("Please enter a command or a line of text: ");  

          oneLine = indata.readLine();   // always need the following two lines to read data

         head.data = Integer.parseInt(oneLine);

         for (int i=1; i<=head.data; i++)

         {System.out.println("Please enter another command or a new line of text:");

               oneLine = indata.readLine();

               int num = Integer.parseInt(oneLine);

               Node p = new Node(num,null);

               q.next = p;

               q = p;}

       }catch(Exception e)

       { System.out.println("Error --" + e.toString());}

 }

public static void main(String[] args)

{Lineeditor mylist = new Lineeditor();

 mylist.Buildlist();

 mylist.Displaylist(head);

}

}

You might be interested in
Concrete ___ support and anchor the bottom of steel columns and wood post, which support beams that are pare of framing system o
dolphi86 [110]
I wanna say it’s D post support
3 0
3 years ago
In the combination of resistors above, consider the 1.50 µΩ and 0.75 µΩ. How can you classify the connection between these two r
Airida [17]

Answer: they are connected in series.

Explanation:

3 0
4 years ago
What entrepreneurial activities do you know?are you capable of doing entrepreneurial activities
kherson [118]

Answer:

.,m

Explanation:

.,m

5 0
3 years ago
Engineers need to be open-ended when dealing with their designs. Why?
melomori [17]
I think the answer would be A if its wrong I’m sorry
7 0
3 years ago
Which of the following are all desirable properties of a hydraulic fluid? a. good heat transfer capability, low viscosity, high
Vinvika [58]

Answer:

e.Fire resistance,Inexpensive,Non-toxic.

Explanation:

Desirable hydraulic property of fluid as follows

1. Good chemical and environment stability

2. Low density

3. Ideal viscosity

4. Fire resistance

5. Better heat dissipation

6. Low flammability

7. Good lubrication capability

8. Low volatility

9. Foam resistance

10. Non-toxic

11. Inexpensive

12. Demulsibility

13. Incompressibility

So our option e is right.

5 0
3 years ago
Other questions:
  • A common way of measuring the thermal conductivity of a material is to sandwich an electric thermofoil heater between two identi
    9·1 answer
  • A completely mixed activated-sludge process is being designed for a wastewater flow of 10,000 m3/d (2.64 mgd) using the kinetics
    6·1 answer
  • An inventor tries to sell you his new heat engine that takes in 40 J of heat at 87°C on each cycle, expels 30 J at 27°C, and doe
    14·1 answer
  • 29
    6·1 answer
  • Ayuda con este problema de empuje y principio de arquimedes.
    6·1 answer
  • Products. of sheet metal​
    8·1 answer
  • What are wheel cylinders used for?
    6·1 answer
  • C programming fundamentals for everyone​
    13·1 answer
  • أجوبة على مسائل في الإستاتيكا أيمكن ذالك
    9·1 answer
  • The policeman was questioning the drivers and searching their vehicles. The drivers ____ and their vehicles ____
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!