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
kenny6666 [7]
3 years ago
14

Write a program that will take a file named Celsius.dat that contains a list of temperatures in Celsius (one per line), and will

create a file Fahrenheit.dat that contains the same temperatures (one per line, in the same order) in Fahrenheit. Note: You may create Celsius.dat using a word processor or any other text editor rather than writing Python code to create the file. It simply needs to be a text file.
Computers and Technology
1 answer:
dedylja [7]3 years ago
5 0

Answer:

celciusFile=open("celcius.dat","r")

fahrenheitFile=open("fahrenheit.dat","w")

# Iterate over each line in the file

for line in celciusFile.readlines():

# Calculate the  fahrenheit

   fahrenheit = 9.0 / 5.0 * float(line) + 32

#write the  Fahrenheit values to the  Fahrenheit file

   fahrenheitFile.write("%.1f\n" % fahrenheit)

# Release used resources

celciusFile.close()

fahrenheitFile.close()

Explanation:

<em></em>

<em>celciusFile=open("celcius.dat","r") </em>

<em>fahrenheitFile=open("fahrenheit.dat","w") </em>

open the Celsius file in the read mode and assign it to a variable.

open the  Fahrenheit file in the write mode and assign it to a variable.

read mode means you can only use/read the content in the file but cannot alter it.

write mode means you can write new data to the file.

<em> </em>

<em />

  • <em># Iterate over each line in the file </em>

<em>for line in celciusFile.readlines(): </em>

The values contained in the Celsius file are collected.

  • <em># Calculate the  fahrenheit </em>

<em>    fahrenheit = 9.0 / 5.0 * float(line) + 32 </em>

The values are then converted to Fahrenheit.

  • <em>#write the  Fahrenheit values to the  Fahrenheit file</em>

<em>    fahrenheitFile.write("%.1f\n" % fahrenheit) </em>

The Fahrenheit values are written to the  Fahrenheit file

<em>%.1f</em><em>  is used to specify the number of digits after decimal. and </em><em>\n </em><em>adds a new line.</em>

<em />

  • <em># Release used resources </em>

<em>celciusFile.close() </em>

<em>fahrenheitFile.close() </em>

All files are closed

<em />

You might be interested in
1.What is a project methodology?
blagie [28]

Explanation:

1. Let’s suppose that we want to test a scientific hypothesis. What we need to do first is to come up with steps and techniques for testing this hypothesis. This, in a similar way explains what project methodologies are. A project methodology gives us a properly organized way of planning and executing a substantial amount of work that needs to be completed in a given amount of time. Think of it as a game plan that you need to up with to develop a product or an IS.

2. Following a particular methodology comes with its own advantages.

  1. 1. It gets you focused on the product you are trying to come up with.
  2. 2. So many lessons will be learnt and will be documented as experiences and will be integrated as best practice. In the event that the project is a success, the same methodology can be used once again in the future.
  3. 3. Saves time since the same prescription of tools, phases, and techniques used for a particular project can be reused once more to come up with another project.

3. It maps out the existence of a project from start to finish. It is defined within a given methodology. Projects, like humans, have defined life-cycles. The same way we come out of wombs, grow, mature, decline, and then die is the same way a project has a beginning, mid, and end.

4. It does not matter whether a project one is working on is huge or not, they have to be organized into a sequence of phases for manageability. These phases include phase exits, stage gates, and kill points. Having these phases aligned together will give an organization a clear indication of how to evaluate the project’s performance and be able to mitigate problems that arise.

5. Starting the next phase just before the current one ends can sometimes be a good thing since it can reduce the schedule of the project. This is what is known as fast tracking. It is a good idea but introducing one phase before another one ends can cause an overlap and as a result can pose as a risk. Do it if the risks are within scope and can be accepted.

6. An idea that someone comes up with to build a new information system or product can be counted as one of the initiation processes of a PLC.  However, the first process is to define the goal of the project. Organizations have put amounts of time and investments into coming up with a project. Therefore, every little aspect of the project should be properly envisioned to meet the business's value. This is phase where we should ask ourselves questions like whether the project is going to be successful and how we will identify its success in correlation to the investments raised by the stakeholders. It is the phase upon which every detail is looked into carefully and goals defined before the project is flagged off.  

7. This phase provides the direction and planning for the project. Once the project has been flagged off and is ready to move forward, the team needs to define what the objectives will be, when and what time the project will be completed, and the amount of money that will be required to finish. In addition, things like how many people are we looking at to complete the project and the technology that will be used to build the project are highly considered and looked into in this phase.

8. At this point, the project must be approved first before moving on to this phase. The teams put all efforts of design, development, and delivery of the final product. Whoever has invested on the product will now start to have a clear picture of everything that is going on from the first phase of planning to the actual implementation based on time it has taken to the budget that has been so far.

9. Every beginning must always have an end and this is the phase that ensures a well-defined end. It ensures that the amount of effort and work that the teams have put in developing and implementing the product is complete. This phase also sees the team and stakeholders have meetings to try and consolidate and come into terms of whether or not the goals of the planning phase have been achieved.

10. Because every single project has its own goals and achievements that it wants to meet. Every product is unique in terms of what it wants to achieve and the principles and practices might not work for every project. It is the processes used to come up with the particular project that will play an integral part in the life cycle

Learn more about project methodologies by clicking on the link below

brainly.com/question/13821095

brainly.com/question/988326

#LearnWithBrainly

4 0
3 years ago
Hi this is for computer and technology experts out there but can someone tell me why my dell computer charger wont work please h
exis [7]
It probably short circuited or something inside your computer hole is broken
7 0
3 years ago
Read 2 more answers
Html version ____ added support for style sheets to give web designers greater control over page layout and appearance.
galina1969 [7]
I believe it was HTML4.




____________________
3 0
3 years ago
Assume that you have 22 slices of pizza and 7 friends that are going to share it (you've already eaten). There's been some argum
xz_007 [3.2K]

Answer:

In Python:

numberOfWholeSlices = int(22/7)

print(numberOfWholeSlices )

Explanation:

For each friend to get a whole number of slices, we need to make use of the int function to get the integer result when the number of slices is divided by the number of people.

So, the number of slice is: 22/7

In python, the expression when assigned to numberOfWholeSlices  is:

numberOfWholeSlices = int(22/7)

Next, is to print the calculated number of slices

print(numberOfWholeSlices )

4 0
3 years ago
Implement a simplified version of a crypto broker platform. Initially, there is an array of users, with each user depositing onl
Salsk061 [2.6K]
Jriririiekeekekkksks
3 0
3 years ago
Other questions:
  • What are some innovations that a cell phone has undergone since its original invention?
    14·1 answer
  • Which of the following is not a reason that the subject line should never be left blank?
    13·2 answers
  • ​according to your text, digital natives tend to prefer different digital communication channels more than do digital immigrants
    5·1 answer
  • What does a computer user need to know about programming in order to play a video game?
    6·2 answers
  • _ is the use of a collection of computers, often owned by many people or different organizations, to work in a coordinated manne
    6·1 answer
  • What do you do to add a line or circle to your presentation?
    7·2 answers
  • I've been trying to sign up but it says that it can't complete my registration right now. How did you guys get in? And how can I
    8·1 answer
  • Why does my wifi keep disconnecting and reconnecting?
    9·1 answer
  • David is preparing a report to show the percentage increase in population in the United States in the last five years. Which fea
    12·1 answer
  • One benefit for a small business using the hosted software model for its enterprise software is that it can succeed without ____
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!