Thursday, June 5, 2014

Celsius To Fahrenheit Conversion


One of the basic programming problems that is given by teachers in computer programming is conversion of values in this example we have Celsius To Fahrenheit Conversion that I wrote using Python as our programming language. This program is very simple I just wrote it to learn the fundamental concepts of Python programming language and also to share this code for individuals and beginners that are interested in Python programming.

The formula to convert Celsius to Fahrenheit is (Celsius * 1.8) + 32 the Celsius here is the value that is given by our user of our program multiplied by 1.8 after we add the value 32 to get the converted results to Fahrenheit.

Below is a function in Python that I wrote to convert Celsius To Fahrenheit.

def  convert_to_celsius(celsius):
  solve = (celsius * 1.8) + 32
  print("Temperature is Celsius is {:.2f}".format(solve));
  return



Sample Output of Our Program


Python Integrated Programming Environment


Program Listing

# Celsius To Fahrenheit Converter
# Written By: Mr. Jake R. Pomperada, MAED-IT
# Tools : Python
# Date  : June 5, 2014 Thurday

def  convert_to_celsius(celsius):
  solve = (celsius * 1.8) + 32
  print("Temperature is Celsius is {:.2f}".format(solve));
  return

print("\n")
print("@==================================@")
print("     Celsius To Fahrenheit Converter     ")
print("@==================================@")

complete = False
while complete == False:
 print("");
 temp = float(input("Kindly Enter Temperature in Celsius :=> "))
 print("");
 convert_to_celsius(temp);
 print("")

 choice = input("Are You Finish?  Y/N: ").lower().strip()

 if choice == "y":
      complete = True
 else:
      print("")

print("\n")
print("Thank You For Using This Program.")
print("\n")       






No comments:

Post a Comment