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
Aleksandr [31]
4 years ago
15

Writa function to read content from "Zone. txt" and write it into another file "zone1. txt" by reversing each line if the line s

tarts with A​
Computers and Technology
1 answer:
julia-pushkina [17]4 years ago
5 0

Answer:

You have specified no language. Here's an algorithm to follow with most platforms, my example is in NodeJS

const fs = require('fs');

let zone = fs.readFile('Zone.txt', 'utf8', function (err, data) {

 if (err) throw new Error(err);

 data = data.toString(); //convert the buffer to a string

 let lines = data.split("\n"),

       content = [];

 for (i in lines) {

   let l = lines[i];

   if (l.toLowerCase().startsWith("a")) l = reverseString(l);

   content.push(l);

 }

 content = content.join("");

 fs.writeFile('zone1.txt', content, , function (err) {

   if (err) throw new Error(err);

 }

});

function reverseString (str) {

   return str.split("").reverse().join("");

}

You might be interested in
Why is it necessary to have a w-2 or 1099 form when using tax preparation software?
Ghella [55]

The reason why it is necessary to have a w-2 or 1099 form when using tax preparation software is to:

  • <u>Allow the software engineer to report his income</u>

According to the given question, we are asked to show the reason why it is <em>necessary</em> to have a W-2 or 1099 form when a software engineer is preparing software.

As a result of this, we can see that these two forms are both used by the Internal Revenue Service so that individuals such as the software engineer can report their income and<em> make their tax payments. </em>

<em />

Read more here:

brainly.com/question/24749083

3 0
3 years ago
Create an application named TurningDemo that creates instances of four classes: Page, Corner, Pancake, and Leaf. Create an inter
pickupchik [31]

Answer:

1) TurningDemo

public class TurningDemo

{   public static void main(String[] args)

 {      

    Leaf obj1 = new Leaf();

    Corner obj2= new Corner();

    Page obj3= new Page();

    Pancake obj4= new Pancake();

 } }

2) ITurnable

public interface ITurnable

{

 public void Turn();

}

3) Leaf class:

public class Leaf implements ITurnable

{

}

Page class:

public class Page implements ITurnable

{

}

Corner class:

public class Corner implements ITurnable

{

}

Pancake class:

public class Pancake implements ITurnable

{

}

Explanation:

The first is TurningDemo application which creates instance obj1, obj2, obj4 and obj4 of four classes Page, Corner, Pancake, and Leaf. new keyword is used to create new object or instance of each class.

The second is ITurnable interface. It contains a single method Turn() which is of type public.

Thirdly, classes named Page, Corner, Pancake, and Leaf implement ITurnable. implements keyword is used to implement a interface so this interface can be used by these classes.

These classes can also implement turn() of ITurnable interface as follows:

Leaf class:

public class Leaf implements ITurnable

{  public void turn()

 {

 }

}

Page class:

public class Page implements ITurnable

{

public void turn()

 {

 }

}

Corner class:

public class Corner implements ITurnable

{ public void turn()

 {

 }

}

Pancake class:

public class Pancake implements ITurnable

{   public void turn()

 {

 }

}

4 0
4 years ago
What is software ownership
kipiarov [429]
Software ownership is a common talking point within organisations. Who owns the license, or who has taken responsibility for ownership.
8 0
3 years ago
An internet layer is a quantity of data that is transmitted on a netowrk without concern for whether it is accurate or whether i
satela [25.4K]

Answer:

False

Explanation:

The statement being made here is a False statement. An internet layer is not necessarily a quantity of data but instead, it is a group of various different codes, programs, and protocols that allow from the data to travel safely from one endpoint to the other. This is what allows one user from one side of the world to send information to someone else who can receive it from the other side of the world through the internet.

7 0
3 years ago
Tin học đã làm thay đổi công tác văn phòng ngày nay như thế nào?
vlabodo [156]
Công nghệ đã thay đổi cách mọi người sử dụng để giao tiếp ở nơi làm việc hiện đại
6 0
3 years ago
Other questions:
  • Please reply only in CORAL. I am not sure how to get the numbers between the negative version and positive version of the input
    10·1 answer
  • The internal area of 2-inch IMC is
    15·2 answers
  • Felicia has been having problems with her computer. Her documents won’t open, her computer is running slow, and programs automat
    7·1 answer
  • An AM index between 0 and 1 indicates what? a. the AM signal is very small and will not be detected by the receiver b. distortio
    12·1 answer
  • A general-use dimmer switch is required to be counted as ? where installed in a single-gang box on a circuit wired with 12 awg c
    15·1 answer
  • How did the new technologies of WWI affect soldiers fighting on the front lines? Please include at least three examples of new t
    5·1 answer
  • Which language is written using 0s and 1S​
    11·1 answer
  • Readable code
    12·2 answers
  • True or false. A plug-in card is always required to support pc sound
    11·2 answers
  • Value (related to the five 'v's' of big data) addresses the pursuit of a meaningful goal. true false
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!