11 Agroup 9
11 Agroup 9
Temperature Converter(Kelvin,Celsius,Fahrenheit)
By Group 9 members-
Lemi Biyana (Leader)
Dagim Alemayehu
Amanuel Yared
Milki Teshome
Yadi Birhanu
Abstract
The project we made for our python class is a temperature unit converter. As we all know there 3
units for measuring temperature namely Celsius, Fahrenheit and kelvin, and the following project
will allow users to enter the value of temperature in any unit they want and gets it converted to
any unit they want.
Table of Contents
Chapter 1-Introduction
Conclusions
Recommendations
Chapter 1-Introduction
As mentioned in the abstract section the temperature converter project allows the user to input the
temperature value by any unit they want and gets it converted by any units they wanted and while
designing the code we used various conditional statements, defined functions and calling them and we
also added comments on important sections to show their use in the code. Now let’s dive into the code
and how we deigned it.
Chapter 2-Objective
As mentioned above the main objective of this project is to allow people convert wanted
temperature values into what they want so rather than using the formulas to manually convert
them they can our project to easily get the results they want.
One of the core programming concepts we used while designing the project include
Functions- we defined functions which are important for the code. One sample used is
Def Celsius_to_fahrenheit(c):
Return (c*9/5)+ 32
As you can see above we defined a function to convert Celsius to Fahrenheit and make it return
the value((c*9/5)+32). Other thing is the arithmetic operations used while defining the return and
you can see on defining the value
Note:This and the other codes shown below in this chapter are just samples other codes used will
we shown in later chapters
Input Functions- the next is we used input functions to allow users to insert the desired
temperature value.
The float function is used to allow users insert a temperature value which is decimal
Conditional statements
Conditional statements used include if, elif and else to condition functions defined to output each
temperature units
If choice==’1’:
Elif choice==’2’:
Print(“Result:”, celsius_to_kelvin(temp),”k”)
So there are two conditions specified by if and elif so when the user is asked from the six
combinations of units formed from the three units they will get the first output if they choose 1
and the second if they choose 2 the rest 4 will be shown later.
Printing output-we also defined functions for showing outputs based on the user’s input
Print(“result:”,Celsius_to_kelvin(temp),” °F”)
This will show the output of the Celsius-based input into kelvin if the user chose the option that
allows so
Function calling -several functions have been called out in order to run the program
Temperature_converter()
Loop and control flow statements- we used while loop to repeat the entire process from allowing
user to choose the unit combination up to outputting the desired result. We also used break to cut
and finish the repeated code when a specific input is inserted while choosing
def temperature_converter():
while True:
print("\nTemperature Converter")
print("7. Exit")
if choice == '7':
print("Exiting the converter. Goodbye!")
break
The break stops the loop with a goodbye print when 7 is inserted while choosing.
This is all about the programming concepts used in designing the project and any questions will
be welcomed!
-our designed project can be used and implemented in many areas such as the health sector as
doctors might want their patient’s temperature to be recorded in other units also scientists who
study climate change and its geographic trend might require our project to easily record the
temperature in their desired unit.
The following will explain how our projects works it can be considered as a guide
-First the user chooses from the temperature combinations I kept talking about. these are:
1. Celsius to Fahrenheit
2. Celsius to Kelvin
3. Fahrenheit to Celsius
4. Fahrenheit to Kelvin
5. Kelvin to Celsius
6. Kelvin to Fahrenheit
So the user chooses from the options above using the number indicating each option so that the
program will evaluate the indicated operation.
After the user chooses from the 6 options the program will ask the use to insert their desired
temperature value and then the program will evaluate it by inserting the value into the
corresponding defined function. If the user inserts 7 on the choosing section the program will
execute break statement to stop the loop and print “Exiting the converter. Goodbye!” . An
example of the process will be shown in chapter 7.
The entire project was made using the following source code:
def celsius_to_fahrenheit(c):
return (c * 9/5) + 32
def celsius_to_kelvin(c):
return c + 273.15
def fahrenheit_to_celsius(f):
def fahrenheit_to_kelvin(f):
def kelvin_to_celsius(k):
return k - 273.15
def kelvin_to_fahrenheit(k):
while True:
print("\nTemperature Converter")
print("7. Exit")
if choice == '7':
if choice == '1':
else:
print("Invalid choice.")
temperature_converter()
The following screenshot image shows the inputs and outputs of our project. It’s when the
python source code is run in programiz python compiler
Chapter 8-Challenges and Limitations Faced
We faced some challenges while designing the python code for our project specially in loop
sections as python is so strict in indentations and loop inclusiveness which made it hard for us to
make the program run repeatedly as long as the user chooses from 1-6 but with the help of the
references shown below we managed to work it out and successfully got what we want. One
limitation is that we were forced to run the codes in online compilers as the code was unable to
run on powershell terminal.
Conclusion- So generally the following python was designed by us group 9 members using
our acquired knowledge during our python classes in IT period with assistance from websites
and AI. We wish that our project meets the expectations of our IT instructor who gave us this
assignment.
Recommendation- For anyone wanting to improve the our project try to add: