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
Holmes owns two suits: one black and one tweed. He always wears either a tweed suit or sandals. Whenever he wears his tweed suit
vazorg [7]

Answer:

He wore his black suit, another color of shirt (not purple) and shoes

Explanation:

Holmes owns two suits: one black and one tweed.

Whenever he wears his tweed suit and a purple shirt, he chooses not to wear a tie and whenever he wears sandals, he always wears a purple shirt.

So, if he wore a bow tie yesterday, it means he wore his black suit, another color of shirt (not purple) and shoes because the shirt color is not purple

4 0
3 years ago
Define the terms (a) thermal conductivity, (b) heat capacity and (c) thermal diffusivity
IceJOKER [234]

Explanation:

<u>(a)</u>

<u>The measure of material's ability to conduct thermal energy (heat) is known as thermal conductivity.</u> For examples, metals have high thermal conductivity, it means that they are very efficient at conducting heat.<u> The SI unit of heat capacity is W/m.K.</u>

The expression for thermal conductivity is:

q=-\kappa \bigtriangledown T

Where,

q is the heat flux

\kappa is the thermal conductivity

\bigtriangledown T is the temperature gradient.

<u>(b)</u>

<u>Heat capacity for a substance is defined as the ratio of the amount of energy required to change the temperature of the substance and the magnitude of temperature change. The SI unit of heat capacity is J/K.</u>

The expression for Heat capacity is:

C=\frac{E}{\Delta T}

Where,

C is the Heat capacity

E is the energy absorbed/released

\Delta T is the change in temperature

<u>(c)</u>

<u>Thermal diffusivity is defined as the thermal conductivity divided by specific heat capacity at constant pressure and its density. The Si unit of thermal diffusivity is m²/s.</u>

The expression for thermal diffusivity is:

\alpha=\frac{\kappa}{C_p \times \rho}

Where,

\alpha is thermal diffusivity

\kappa is the thermal conductivity

C_p is specific heat capacity at constant pressure

\rho is density

6 0
3 years ago
It is an important part of the differential maintenance which purpose is to make smoother the differential operation by lubricat
masha68 [24]

Answer:

lubrication

Explanation:

MARK ME BRAINLEIST

4 0
2 years ago
ENERGIA
VMariaS [17]

nswer:

i dont understand french

97

Explanation:

4 0
2 years ago
A piston-cylinder apparatus has a piston of mass 2kg and diameterof
iragen [17]

Answer:

M =2.33 kg

Explanation:

given data:

mass of piston - 2kg

diameter of piston is 10 cm

height of water 30 cm

atmospheric pressure 101 kPa

water temperature = 50°C

Density of water at 50 degree celcius is 988kg/m^3

volume of cylinder is  V = A \times h

                                       = \pi r^2 \times h

                                       = \pi 0.05^2\times 0.3

mass of available in the given container is

M = V\times d

  = volume \times density

= \pi 0.05^2\times 0.3 \times 988

M =2.33 kg

6 0
3 years ago
Other questions:
  • How many grams of perchloric acid, HClO4, are contained in 37.6 g of 70.5 wt% aqueous perchloric acid? How many grams of water a
    10·1 answer
  • What is compression ratio of an Otto cycle? How does it affect the thermal efficiency of the cycle?
    14·1 answer
  • A car is traveling at 36 km/h on an acceleration lane to a freeway. What acceleration is required to obtain a speed of 72 km/h i
    12·1 answer
  • According to the EWR specifications, ___ is responsible for picking up and disposing of debris or rubbish from
    15·1 answer
  • Thermodynamics deals with the macroscopic properties of materials. Scientists can make quantitative predictions about these macr
    13·1 answer
  • Complete the following sentence.
    7·1 answer
  • which one of the following appliance parts gets the hardest services? A. Heating elementwhich one of the following appliance par
    10·2 answers
  • All welding processes that take place without melting of the work pieces. a)- True b)-False
    15·1 answer
  • The toughness of a material does what, when it's been heated?​
    7·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
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!