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
The alternator must be operated with the battery disconnected or with the terminals at the back of the alternator
QveST [7]

Answer:

true

Explanation:

4 0
3 years ago
Read 2 more answers
Compute the volume percent of graphite, VGr, in a 2.5 wt% C cast iron, assuming that all the carbon exists as the graphite phase
ludmilkaskok [199]

Answer:

The volume percent of graphite is 91.906 per cent.

Explanation:

The volume percent of graphite (\% V_{Gr}) is determined by the following expression:

\%V_{Gr} = \frac{V_{Gr}}{V_{Gr}+V_{Fe}} \times 100\,\%

\%V_{Gr} = \frac{1}{1+\frac{V_{Gr}}{V_{Fe}} }\times 100\,\%

Where:

V_{Gr} - Volume occupied by the graphite phase, measured in cubic centimeters.

V_{Fe} - Volume occupied by the ferrite phase, measured in cubic centimeters.

The volume of each phase can be calculated in terms of its density and mass. That is:

V_{Gr} = \frac{m_{Gr}}{\rho_{Gr}}

V_{Fe} = \frac{m_{Fe}}{\rho_{Fe}}

Where:

m_{Gr}, m_{Fe} - Masses of the graphite and ferrite phases, measured in grams.

\rho_{Gr}, \rho_{Fe} - Densities of the graphite and ferrite phases, measured in grams per cubic centimeter.

Let substitute each volume in the definition of the volume percent of graphite:

\%V_{Gr} = \frac{1}{1 +\frac{\frac{m_{Gr}}{\rho_{Gr}} }{\frac{m_{Fe}}{\rho_{Fe}} } } \times 100\,\%

\%V_{Gr} = \frac{1}{1+\left(\frac{m_{Gr}}{m_{Fe}} \right)\cdot \left(\frac{\rho_{Fe}}{\rho_{Gr}} \right)}\times 100\,\%

Let suppose that 100 grams of cast iron are available, masses of each phase are now determined:

m_{Gr} = \frac{2.5}{100}\times (100\,g)

m_{Gr} = 2.5\,g

m_{Fe} = 100\,g - 2.5\,g

m_{Fe} = 97.5\,g

If m_{Gr} = 2.5\,g, m_{Fe} = 97.5\,g, \rho_{Fe} = 7.9\,\frac{g}{cm^{3}} and \rho_{Gr} = 2.3\,\frac{g}{cm^{3}}, the volume percent of graphite is:

\%V_{Gr} = \frac{1}{1+\left(\frac{2.5\,gr}{97.5\,gr} \right)\cdot \left(\frac{7.9\,\frac{g}{cm^{3}} }{2.3\,\frac{g}{cm^{3}} } \right)} \times 100\,\%

\% V_{Gr} = 91.906\,\%

The volume percent of graphite is 91.906 per cent.

6 0
2 years ago
Fluorescent troffers are a type of _ lighting fixture
creativ13 [48]
The answer would be letter A
8 0
3 years ago
An energy system can be approximated to simply show the interactions with its environment including cold air in and warm air out
Elenna [48]

Answer: The energy system related to your question is missing attached below is the energy system.

answer:

a) Work done = Net heat transfer

  Q1 - Q2 + Q + W = 0

b)  rate of work input ( W ) = 6.88 kW

Explanation:

Assuming CPair = 1.005 KJ/Kg/K

<u>Write the First law balance around the system and rate of work input to the system</u>

First law balance ( thermodynamics ) :

Work done = Net heat transfer

Q1 - Q2 + Q + W = 0 ---- ( 1 )

rate of work input into the system

W = Q2 - Q1 - Q -------- ( 2 )

where : Q2 = mCp T  = 1.65 * 1.005 * 293 = 485.86 Kw

             Q2 = mCp T = 1.65 * 1.005 * 308 = 510.74 Kw

              Q = 18 Kw

Insert values into equation 2 above

W = 6.88 Kw

5 0
2 years ago
Write two scnr.nextInt statements to get input values into birthMonth and birthYear. Then write a statement to output the month,
aalyn [17]

Answer:

import java.util.Scanner;

public class InputExample {

   public static void main(String[] args) {

       Scanner scnr = new Scanner(System.in);

       int birthMonth;

       int birthYear;

       birthMonth = scnr.nextInt();

       birthYear = scnr.nextInt();

       System.out.println(birthMonth+"/"+birthYear);

   }

}

3 0
3 years ago
Other questions:
  • ¿Por qué creen que la Ingeniería Metalúrgica es una carrera estratégica para el desarrollo de nuestro país?
    9·1 answer
  • A flocculation basin equipped with revolving paddles is 60 ft long (the direction of flow). 45 ft wide, and 14 ft deep and treat
    11·1 answer
  • Steam at 150 bars and 600°C passes through process equipment and emerges at 100 bars and 700°C. There is no flow of work into or
    8·1 answer
  • What’s a pnp transitor?
    5·2 answers
  • Analyze the following ideal transistor circuit. Can use general rule of thumbs for analyzing transistors b-base, c- collector, a
    9·2 answers
  • Plz answer all of these questions!
    15·1 answer
  • true or false modeling is making predictions about future data points not associated with your equation? Explain why.​
    12·1 answer
  • Global climate and weather patterns are driven by differences in the amount of heat energy in different areas of the earth. Whic
    9·1 answer
  • What is the first step of the engineering design process?
    9·2 answers
  • A hammer can be used to see how a mineral breaks. If you observe square chunks of the mineral when broken, what can you conclude
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!