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
Wet steam at 15 bar is throttled adiabatically in a steady-flow process to 2 bar. The resulting stream has a temperature of 130°
cricket20 [7]

Answer:

\Delta s = 0.8708\,\frac{kJ}{kg\cdot K}

Explanation:

The adiabatic throttling process is modelled after the First Law of Thermodynamics:

m\cdot (h_{in} - h_{out}) = 0

h_{in} = h_{out}

Properties of water at inlet and outlet are obtained from steam tables:

State 1 - Inlet (Liquid-Vapor Mixture)

P = 1500\,kPa

T = 198.29\,^{\textdegree}C

h = 2726.9\,\frac{kJ}{kg}

s = 6.3068\,\frac{kJ}{kg\cdot K}

x = 0.967

State 2 - Outlet (Superheated Vapor)

P = 200\,kPa

T = 130\,^{\textdegree}C

h = 2726.9\,\frac{kJ}{kg}

s = 7.1776\,\frac{kJ}{kg\cdot K}

The change of entropy of the steam is derived of the Second Law of Thermodynamics:

\Delta s = 7.1776\,\frac{kJ}{kg\cdot K} - 6.3068\, \frac{kJ}{kg\cdot K}

\Delta s = 0.8708\,\frac{kJ}{kg\cdot K}

6 0
3 years ago
What is the simplified meaning of the word "engineering"​
juin [17]

Answer:

.

Explanation:

.

4 0
3 years ago
This is hard please help me you will give brainlist
Musya8 [376]
It spirals clockwise
5 0
2 years ago
Read 2 more answers
If the price of the car is less than or equal to your available cash, display "no". If the price of the car is more than your av
Ede4ka [16]

Answer:

function decision(car_price, available_cash) {

   if(car_price <= available_cash) {

   console.log("no");

   }

   else  {

   console.log("yes");

   }

   }

decision(car_price, available_cash); or decision(available_cash, car_price);

Explanation:

using functions in Javascript:

functions; this refers to dividing codes into reusable parts.

e.g function function_name() {

console.log("How are you?");

}

you can call or invoke this function by using its name followed by parenthesis, like this: function_name(). each time the function is called it will   print out "How are you?".

Parameters: these are variables that act as placeholders for the values that are to be input into a function when it is called

Arguments: The actual values that input or passed into a function when it is called.

e.g

function function_name(parameter1, parameter2) {

console.log(parameter1, parameter2);

}

then we call function_name: function_name("please", "leave"):we have passed two arguments, "please"  and "leave". Inside the function parameter1 equals "please" while parameter2 equals "leave".

Hence, from the question given the two parameters "car_price" and "available_cash" respectively, we write the function with name function_name:

function decision(car_price, available_cash) {

   if(car_price <= available_cash) {

   console.log("no");

   }

   else  {

   console.log("yes");

   }

   }

decision(car_price, available_cash); or decision(available_cash, car_price);

7 0
3 years ago
4. The outer end of a control arm is attached to the steering knuckle through a
arlik [135]
Is attached to the spring
3 0
3 years ago
Read 2 more answers
Other questions:
  • What is Not considered as metric system ? a. Length b. Mass c. Time d. Volume e. Temperature
    9·2 answers
  • Engineering is a broad category that includes a variety of occupations and attempts to solve problems using math and
    13·1 answer
  • Find the pressure exerted by the water bed on the floor when the bed rests in its normal position. Assume the entire lower surfa
    12·1 answer
  • A closed system undergoes a process in which work is done on the system and the heat transfer Q occurs only at temperature Tb. F
    8·1 answer
  • #198. Moment of inertia about center of a segmented bar A bar of width is formed of three uniform segments with lengths and area
    7·1 answer
  • Which of these is least likely a step in replacing a failed compressor?
    12·2 answers
  • How do I calculate the gear ratio​
    6·1 answer
  • In Engineering, what is a shoulder on a bridge?
    8·1 answer
  • If you are setting up a race car. What is the cross weight? Does it matter?
    5·1 answer
  • Refrigerant-134a enters an adiabatic compressor at -30oC as a saturated vapor at a rate of 0.45 m3 /min and leaves at 900 kPa an
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!