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]
2 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]2 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
A_________is a way for students to keep track of information during research.
Fudgin [204]
Note pad your welcome


4 0
3 years ago
Given the variables full_admission_price and discount_amount (already defined), write an expression corresponding to the price o
stiks02 [169]

Answer:

if full_admission_price = f and discount_amount = d

=> Price of a discount admission = d/f

total_weight

quantity

weight of one item = total_weight/quantity                      

for i in range(80, 18, -2):

   print(i, end=' ')

Explanation:

The first two questions are just mathematical to get a single quantity given some relationship. So, its basically division

For the python code, I used the python's range function which takes in three arguments. The first one is the starting value, the second one is the terminating value which is the number before the terminating value and the last one specifies the common difference popularly known as step in the language. Since the step is 2, only even numbers are printed out. In the print function, I made use of the end keyword specifying a space (' ') as the end. This ensures that the print is done in the same line with a space seperating them. Without that specification, each result will printed in a newline

7 0
3 years ago
3.29 LAB: Login name Write a program that creates a login name for a user, given the user's first name, last name, and a four-di
romanna [79]

Answer:

In C++:

#include <iostream>

using namespace std;

int main(){

   string fname,lname; int num;

   cout<<"Firstname: "; cin>>fname;

   cout<<"Lastname: "; cin>>lname;

   cout<<"4 digits: "; cin>>num;

   string login = lname;

   if(lname.length()>=5){

       login = lname.substr(0, 5);    }

   login+=fname.substr(0,1)+to_string(num%100);

   cout<<login;

   return 0;

}

Explanation:

See attachment for explanation where I used comments to explain each line

Download cpp
4 0
2 years ago
What are the oop concept of java
mash [69]

Answer: OOP concepts in Java are the main ideas behind Java’s Object Oriented Programming. They are abstraction, encapsulation, inheritance, and polymorphism. Grasping them is key to understanding how Java works. Basically, Java OOP concepts let us create working methods and variables, then re-use all or part of them without compromising security.

HOPE THIS HELPED IS NOT SORRY.

4 0
2 years ago
Read 2 more answers
Under the Home tab, where can a user find options to change the bullet style of an outline?
fomenos
Created a new multilevel list style to add to the gallery
5 0
2 years ago
Other questions:
  • To save a file so that it can be opened on most computers, select the _____ option.
    9·2 answers
  • This operator represents the logical AND.
    7·1 answer
  • What field in a TCP segment is used to determine if an arriving data unit exactly matches the data unit sent by the source?]
    10·1 answer
  • What is IaaS? For this service model, what are the resources the cloud vendor will provide/manage and what are the resources the
    15·1 answer
  • The primary reason for the creation of the Federal Reserve System LOADING... ​was: A. to create a single central bank similar to
    7·1 answer
  • How can a user begin to work with a new sheet in excel?
    9·1 answer
  • Your first submission for the CIS 210 Course Project should include the following functionality: - Requests the user to input hi
    13·1 answer
  • In order for a sort to work, which of the following is required?
    14·1 answer
  • What actions might contribute to recommendations you see online?
    9·1 answer
  • In what year was the first permanent photographic image created?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!