0% found this document useful (0 votes)
4 views11 pages

11 Agroup 9

The document outlines a temperature converter project developed by Group 9 for their Python class, allowing users to convert temperatures between Celsius, Fahrenheit, and Kelvin. It details the project's objectives, programming concepts used, design and implementation, functionalities, and challenges faced during development. The project aims to simplify temperature conversions and includes recommendations for future improvements.

Uploaded by

biyanaelili
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views11 pages

11 Agroup 9

The document outlines a temperature converter project developed by Group 9 for their Python class, allowing users to convert temperatures between Celsius, Fahrenheit, and Kelvin. It details the project's objectives, programming concepts used, design and implementation, functionalities, and challenges faced during development. The project aims to simplify temperature conversions and includes recommendations for future improvements.

Uploaded by

biyanaelili
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 11

ST JOHN BAPTIST DELA SALLE CATHOLIC SCHOOL

Temperature Converter(Kelvin,Celsius,Fahrenheit)
By Group 9 members-
Lemi Biyana (Leader)

Amanuel Gezahegn(Report writer)

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

Chapter 2-Objective of the project

Chapter 3-Programming concepts used

Chapter 4-Project design and implementation

Chapter 5-Functionalities and program flow design


Chapter 6-Source code

Chapter 7-Sample input and outputs(screenshots)

Chapter 8-challenges and limitations faced

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.

Chapter 3-Programming concepts used

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.

Temp=float(input(“enter the temperature:”))

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’:

Print(“result:”, Celsius_to_fahrenheit(temp),” °F”)

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()

This allows the value assigned to be added to the function.

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("1. Celsius to Fahrenheit")

print("2. Celsius to Kelvin")

print("3. Fahrenheit to Celsius")

print("4. Fahrenheit to Kelvin")

print("5. Kelvin to Celsius")

print("6. Kelvin to Fahrenheit")

print("7. Exit")

choice = input("Enter your choice (1-7): ")

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!

Chapter 4-Program design and implementation

-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.

Chapter 5-Functionalities and control flow design

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.

Chapter 6-Source code-

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):

return (f - 32) * 5/9

def fahrenheit_to_kelvin(f):

return (f - 32) * 5/9 + 273.15

def kelvin_to_celsius(k):

return k - 273.15

def kelvin_to_fahrenheit(k):

return (k - 273.15) * 9/5 + 32


def temperature_converter():

while True:

print("\nTemperature Converter")

print("1. Celsius to Fahrenheit")

print("2. Celsius to Kelvin")

print("3. Fahrenheit to Celsius")

print("4. Fahrenheit to Kelvin")

print("5. Kelvin to Celsius")

print("6. Kelvin to Fahrenheit")

print("7. Exit")

choice = input("Enter your choice (1-7): ")

if choice == '7':

print("Exiting the converter. Goodbye!")

break # <-- This is inside while True

temp = float(input("Enter the temperature: "))

if choice == '1':

print("Result:", celsius_to_fahrenheit(temp), "°F")


elif choice == '2':

print("Result:", celsius_to_kelvin(temp), "K")

elif choice == '3':

print("Result:", fahrenheit_to_celsius(temp), "°C")

elif choice == '4':

print("Result:", fahrenheit_to_kelvin(temp), "K")

elif choice == '5':

print("Result:", kelvin_to_celsius(temp), "°C")

elif choice == '6':

print("Result:", kelvin_to_fahrenheit(temp), "°F")

else:

print("Invalid choice.")

# Run the converter

temperature_converter()

Chapter 7 Sample inputs and outputs

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:

- Feature to save past outputs into a file

- Adjust it to fully run on powershell and other terminals


References- Our references include stack overflow , byjus and w3 schools .

You might also like