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
mestny [16]
3 years ago
7

Write a program that will open a file named thisFile.txt and write every other line into the file thatFile.txt. Assume the input

file (thisFile.txt) resides in the same directory as your code file, and that your output file (thatFile.txt) will reside in the same location. Do not attempt to read from or write to other locations.
Computers and Technology
1 answer:
Naily [24]3 years ago
4 0

Answer:

Check the explanation

Explanation:

The programmable code to solve the question above will be written in a python programming language <u><em>(which is a high-level, interpreted, general-purpose programming language.)</em></u>

<u><em /></u>

f = open('thisFile.txt', 'r')

w = open('thatFile.txt', 'w')

count = 0

for line in f:

   if count % 2 == 0:

       w.write(line)

   count += 1

w.close()

f.close()

You might be interested in
The two primary methods of memory allocation are:
levacccp [35]

Answer:

The answer is

Stack and heap

4 0
3 years ago
Given : an int variable k, an int array currentMembers that has been declared and initialized, an int variable nMembers that con
atroni [7]

Answer:

The following are the code in the Java Programming Language.

//set the for loop

for (k = 0; k < nMembers; k++)

{

//check that currentMembers[k] is equal to the memberID

if (currentMembers[k] == memberID)

{

//then, initialize isAMember to true

isAMember = true;

//and initialize the value of nMembers in k

k = nMembers;

}

//otherwise

else

{

//initialize isAMember to false

isAMember = false;

}

}

Explanation:

<u>The following are the description of the program</u>.

  • Set the for loop statement that iterates from 0 and stops at the variable 'nMembers'.
  • Set the if conditional statement that checks the variable 'currentMembers[k]' is equal to the variable 'memberID' then, initialize 'true' boolean value in the variable 'isAMember' and also initialize the value of the variable 'nMembers' in the variable 'k'.
  • Otherwise, initialize 'false' boolean value in the variable 'isAMember'.
6 0
3 years ago
Which of the following describe the characteristics of a good logo? Choose all that apply. It is a complex design It is memorabl
nasty-shy [4]

Answer:

It is memorable.

It utilizes the elements of design.

Explanation:

IMO these 2 will determine a good logo. Since everyone should remember it if they come across it again in the future

6 0
2 years ago
What value will the color variable have after these lines of code run?
hoa [83]

Answer:

red

Explanation:

color is set to red in the last line of being defined.

5 0
3 years ago
What was the first computer to defeat a world champion chess player?
deff fn [24]
deep blue IBM's chess-playing computer
6 0
4 years ago
Other questions:
  • When making college visits, you may be able to....
    9·2 answers
  • A TCP entity opens a connection and uses slow start. Approximately how many round-trip times are required before TCP can send N
    11·1 answer
  • A programmer is writing a system that is intended to be able to store large amounts of personal data. As the programmer develops
    11·1 answer
  • public class Test { public static void main(String[] args) { try { method(); System.out.println("After the method call"); } catc
    12·1 answer
  • The Michael Porter Diamond of National Advantage is a framework that explains why countries foster successful multinational corp
    11·1 answer
  • A web feed:
    7·2 answers
  • The art element line is a moving point.<br><br><br> True or False
    15·1 answer
  • How should technology be used?
    9·2 answers
  • What data type of data type would you use to represent the registration letter of a car​
    5·2 answers
  • question 1 scenario 1, question 1-5 you’ve just started a new job as a data analyst. you’re working for a midsized pharmacy chai
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!