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
"Which hash algorithm's primary design feature is two different and independent parallel chains of computation, the results of w
Galina-37 [17]

Answer:

Option C i.e., RIPEMD is the correct option for the following question.

Explanation:

Because RIPEMD is the algorithm that is used for the hash primary design characteristic which has two independent and unlike parallel chains of the calculation and computation and the outputs of which are then linked to the process at the end. It is also used for the safe process of replacing the 128-bit hash method.

Other options are wrong because these are not related to the following statement.

5 0
3 years ago
Can someone help me with python
pishuonlain [190]

Answer:

here

Explanation:

Python is an interpreted high-level general-purpose programming language. Its design philosophy emphasizes code readability with its use of significant indentation.

7 0
3 years ago
What is the film format that many filmmakers feel is superior to any other format?
Kobotan [32]

Answer:

digital

Explanation:

7 0
3 years ago
Task 2
adelina 88 [10]

The program is an illustration of file manipulations

<h3>What are file manipulations?</h3>

File manipulations are program statements that are used to write & append to file, and also read from the file

<h3>The actual program in Python</h3>

Assume the file name is top10.txt, the program in Python where comments are used to explain each line is as follows:

#This opens the file

a_file = open("top10.txt")

#This reads the file contents

file_contents = a_file.read()

#This prints the contents

print(file_contents)

Read more about file manipulations at:

brainly.com/question/15683939

3 0
2 years ago
QUICK HELP ME PLEASE
Sholpan [36]

Answer: Cable Internet access requires the setting up of fiber cables. It is the fastest type of Internet access technology. that's the answer

4 0
3 years ago
Other questions:
  • Is microsoft word the same as microsoft office?
    12·2 answers
  • Which diagrams represent how roles can affect careers and lifestyles
    11·1 answer
  • How do you enlarge your screen if there is no control panel? Need desperate help!
    15·1 answer
  • Drag the tiles to the correct boxes to complete the pairs.
    13·1 answer
  • As an ICT student teacher using convincing and cogent reasons explain why you think operating system is pivotal in teaching and
    7·1 answer
  • Which of these devices is usually the default for most home network?
    12·1 answer
  • Consider the series of alternating 1s and 0s 1 0 1 0 1 0 1 0 1 0 ...... The user will enter a number n . And you have to output
    10·1 answer
  • What are business rules​
    14·1 answer
  • It's the same drop-down answers for both.
    15·1 answer
  • Type the correct answer in each box. Spell all words correctly, and use numerals instead of words for numbers. If necessary, use
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!