Question

Write a function that writes a temperature conversion table called tempConv.txt. The table should include temperatures...

Write a function that writes a temperature conversion table called tempConv.txt. The table should include temperatures from −300 to 212 degrees Fahrenheit and their Celsius equivalents, presented in two columns with appropriate headings. Each column should be 10 characters wide, and each temperature should have 3 digits to the right of the decimal point.

PYHON ONLY!!! NO JAVA, THAT DOES NOT HELP

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Program:

#fTemp - Fahrenheit
#cTemp - Celsius

def conversion():
   output="Fahrenhiet Celsius\n"
   for fTemp in range(-300,213):
       cTemp=(fTemp-32)* 5/9
       output=output+"{:10.3f}".format(fTemp)+" "
       output=output+"{:10.3f}".format(cTemp)+"\n"
  
   txtFile=open("tempConv.txt","w")
   txtFile.write(output)
   print("temperatures stored succefully!!")
   txtFile.close();
          

conversion()  
      


Program Screenshot:

Output:

Add a comment
Know the answer?
Add Answer to:
Write a function that writes a temperature conversion table called tempConv.txt. The table should include temperatures...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT