In: Computer Science
Write a program that displays a temperature conversion table for degrees Celsius and degrees Fahrenheit. The table should include rows for all temperatures between 0 and 100 degrees Celsius that are multiples of 10 degrees Celsius. Include appropriate headings on your columns. The formula for converting between degrees Celsius and degrees Fahrenheit can be found on the internet.
Python 3
Source Code:
Output:
Code in text format (See above images of code for indentation):
#print header
print(" *****Temperature Converter*****")
print("|-------------------------------|")
print("| Celsius\t| Fahrenheit |")
print("|-------------------------------|")
#for loop iterates upto 0 to 100
for i in range(101):
#check for multiples of 10
if(i%10==0):
#convert to fahrenheit
f=(i*(9/5))+32
#print conversion
print("|\t",i,"\t|\t",f,"\t|")
print("|-------------------------------|")