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
What is one of the most common ways workers get hurt around machines
-BARSIC- [3]

Answer:

if their body parts stuck in a machine,if machine expl

Explanation:

ode.

4 0
3 years ago
For each function , sketch the Bode asymptotic magnitude and asymptotic phase plots.
horrorfan [7]

Answer:

attached below

Explanation:

a) G(s) = 1 / s( s+2)(s + 4 )

Bode asymptotic magnitude and asymptotic phase plots

attached below

b) G(s) = (s+5)/(s+2)(s+4)

phase angles = tan^-1 w/s , -tan^-1 w/s , tan^-1 w/4

attached below

c) G(s)= (s+3)(s+5)/s(s+2)(s+4)

solution attached below

5 0
3 years ago
I NEED HELP HERE SUM POINTS ( i will report if you put a link and or no answer
Y_Kistochka [10]

Answer:

ok I will help you ha Ha ha ha ha ha ha ha ha ha ha ha

8 0
2 years ago
The mechanical energy of an object is a combination of its potential energy and its
saveliy_v [14]

The mechanical energy of an object is a combination of its potential energy and its <em><u>kinetic</u></em><em><u> </u></em><em><u>energy</u></em><em><u>.</u></em>

6 0
2 years ago
Explain what are rafters?
RSB [31]

Answer:

rafter is a structural component that is used as part of a roof construction. There are also different types of rafters

8 0
2 years ago
Other questions:
  • Which situation might cause potential hazards at a construction site?
    12·2 answers
  • Assuming that the following three variables have already been declared, which variable will store a Boolean value after these st
    14·1 answer
  • Overview In C, a string is simply an array of characters. We have used literal strings all along – the stuff in between the quot
    11·1 answer
  • A spring (70 N/m ) has an equilibrium length of 1.00 m. The spring is compressed to a length of 0.50 m and a mass of 2.2 kg is p
    14·2 answers
  • A long rod of 60-mm diameter and thermophysical properties rho=8000 kg/m^3, c=500J/kgK, and k=50 W/mK is initally at a uniform t
    8·1 answer
  • Four eight-ohm speakers are connected in parallel to an audio power amplifier. The amplifier can supply a maximum driver output
    12·1 answer
  • WILL MARK BRAINLIST I need help on this asap thanks
    15·1 answer
  • Chad is working on a design that uses the pressure of steam to control a valve in order to increase water pressure in showers. W
    5·1 answer
  • A cross beam in a highway bridge experiences a stress of 14 ksi due to the dead weight of the bridge structure. When a fully loa
    14·1 answer
  • A book sitting on a shelf is an example of ____________.
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!