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]
2 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]2 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
Consider a CMOS inverter which has ideal transistors with the following characteristics: PMOS transistor: W/L = 2; Mobility (up)
yaroslaw [1]

Answer:

The transistor will be in amplifier mode and we will expect current will be higher than expected.

6 0
3 years ago
python Write a program that takes a date as input and outputs the date's season. The input is a string to represent the month an
kupik [55]

Answer:

month = input("Input the month (e.g. January, February etc.): ")

day = int(input("Input the day: "))

if month in ('January', 'February', 'March'):

season = 'winter'

elif month in ('April', 'May', 'June'):

season = 'spring'

elif month in ('July', 'August', 'September'):

season = 'summer'

else:

season = 'autumn'

if (month == 'March') and (day > 19):

season = 'spring'

elif (month == 'June') and (day > 20):

season = 'summer'

elif (month == 'September') and (day > 21):

season = 'autumn'

elif (month == 'December') and (day > 20):

season = 'winter'

print("Season is",season)

Explanation:

4 0
2 years ago
Who is responsible for conducting a hazard assessment?
slava [35]

Answer:

The Employee

Explanation:

Because it is there responsibility

5 0
3 years ago
What is the objective of phasing out an INDUCTION MOTOR before putting the machine into commission?
enyata [817]

The main objective of phasing out an INDUCTION MOTOR is to identify the ends of the stator coils.

<h3>What is an induction motor?</h3>

An induction motor is a device based on alternate electricity (AC) which is composed of three different stator coils.

An induction motor is a device also known as an asynchronous motor due to its irregular velocity.

In conclusion, the objective of phasing out an INDUCTION MOTOR is to identify the ends of the stator coils.

Learn more on induction motors here:

brainly.com/question/15721280

#SPJ1

8 0
2 years ago
Which option identifies the concept represented in the following scenario?
dlinn [17]

Answer:

project object

Explanation:

3 0
2 years ago
Other questions:
  • A small truck is to be driven down a 4% grade at 70 mi/h. The coefficient of road adhesion is 0.95, and it is known that the bra
    7·1 answer
  • A device that helps increase field worker productivity by providing reliable location and time
    13·1 answer
  • You're running an engine and seeing that it is exhausting blue smoke. Which is likely to
    9·1 answer
  • A 0.39 percent Carbon hypoeutectoid plain-carbon steel is slowly cooled from 950 oC to a temperature just slightly below 723 oC.
    15·1 answer
  • Exercise 5.46 computes the standard deviation of numbers. This exercise uses a different but equivalent formula to compute the s
    12·1 answer
  • Thoughts about drinking and driving
    12·2 answers
  • If 3 varies inversely as x and y=2 when x=25, find x when y=40
    7·1 answer
  • one number is 11 more than another number. find the two number if three times the larger number exceeds four times the smaller n
    14·1 answer
  • Is the pure fission bomb a nuclear bomb?
    5·1 answer
  • The phase angle in a circuit is 45 degrees what's the power factor of this circuit?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!