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
Dcfxvfsvcfsfvfssvdaeeaew
Ainat [17]

Answer:

meepus weepus

Explanation:

8 0
3 years ago
Read 2 more answers
What is the first thing to do when you make a three-point turn?.
Jlenok [28]

Answer:

1. Move as far right as possible, check traffic, and signal a left turn.

2. Turn the steering wheel sharply to the left and move forward slowly.

3. Shift to reverse, turn your wheels sharply to the right, check traffic, and back your vehicle to the right curb, or edge of roadway.

5 0
3 years ago
Describe how you might use the concept of parts presentation to help a classroom full of children complete a craft project. Disc
Ket [755]

Answer:

Encouraging your preschooler’s creative play

For your preschooler, time, materials and space to be creative are very important.

Preschoolers like to be spontaneous in their creative play, so it’s good to follow your child’s lead. But there’ll also be times when your child wants you to be more involved in her creative activities. By being actively involved, you can develop your child’s skills and understanding.

3 0
3 years ago
If a torque of M = 300 N⋅m is applied to the flywheel, determine the force that must be developed in the hydraulic cylinder CD t
Licemer1 [7]

Answer:

<em>866.1 N</em>

Explanation:

The torque on the flywheel = 300 N-m

The force from the hydraulic cylinder will generate a moment on CA about point A.

The part of this moment that will be at point B about A must be proportional to the torque on the cylinder which is 300 N-m

we know that moment = F x d

where F is the force, and

d is the perpendicular distance from the turning point = 1 m

Equating, we have

300 = F x 1

F = 300 N   this is the frictional force that stops the flywheel

From F = μN

where F is the frictional force

μ is the coefficient of static friction = 0.4

N is the normal force from the hydraulic cylinder

substituting, we have

300 = 0.4 x N

N = 300/0.4 = 750 N

This normal force calculated is perpendicular to CA. This actual force, is at 30° from the horizontal. To get the force from the hydraulic cylinder R, we use the relationship

N = R sin (90 - 30)

750 = R sin 60°

750 = 0.866R

R = 750/0.866 = <em>866.1 N</em>

3 0
3 years ago
Consider the following incomplete code segment, which is intended to print the sum of the digits in num. For example, when num i
ValentinkaMS [17]

Answer:

A) while (num >= 0)

Explanation:

To understand why we need to focus on the module and division operation inside the loop. num % 10 divide the number by ten and take its remainder to then add this remainder to sum, the important here is that we are adding up the number in reverse order and wee need to repeat this process until we get the first number (1%10 = 1), therefore, num need to be one to compute the last operation.

A) this is the correct option because num = 1 > 0 and the last operation will be performed, and after the last operation, num = 1 will be divided by 10 resulting in 0 and 0 is not greater than 0, therefore, the cycle end and the result will be printed.

B) This can not be the option because this way the program will never ends -> 0%10 = 0 and num = 0/10 = 0

C) This can not be the option because num = 1 > 1 will produce an early end of the loop printing an incomplete result

D) The same problem than C

E) There is a point, before the operations finish, where sum > num, this will produce an early end of the loop, printing an incomplete result

6 0
3 years ago
Other questions:
  • What can you do to prepare for a long distance trip
    5·2 answers
  • 5. Identify the pros and cons of<br> manufactured siding.
    12·1 answer
  • If your only source of power was 120 VAC from a wall outlet, but you were required to have 5 VAC as input for an electronic devi
    9·1 answer
  • The costs of mining and transporting coal are roughly independent of the heating value of the coal. Consider:
    15·1 answer
  • Both a gage and a manometer are attached to a gas tank to measure its pressure. If the reading on the pressure gage is 65 kPa, d
    9·1 answer
  • Which of the following is a direct result of technological improvements in the music industry?
    9·2 answers
  • 2. How many amperes of current will flow through a circuit that has 3 ohms of resistance if
    5·1 answer
  • Introduce yourself to the class and
    12·1 answer
  • What is the role of engineers in nation building <br><br>​
    13·2 answers
  • Write the design brief (identify the problem) of mine headgear​
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!