COMPUTER SCIENCE
PROJECT FILE
SESSION: 2023 – 2024
Presented by:
DARSHIL GUPTA
OM KUMAR
AALOK
CERTIFICATE
This is to certify that the group of Class XI A, has
successfully completed the Computer Science project
on the topic ‘Unit Converter’ under the guidance of
Mrs. Neeti Chhibber.
The progress of the project has been continuously
reported and has been acknowledge consistently.
Mrs. Neeti Chhibber
(Computer Science Teacher)
INDEX
[Link]. TOPIC T. SIGN.
1. Introduction
2. Objective (Explanation of the Project)
3. Source Code
4. Outputs
5. Application
6. Future Scope
7. Bibliography
Introduction
A Unit Converter is a useful tool that helps in converting
measurements from one unit to another. Whether it's
converting temperature from Celsius to Fahrenheit, length
from meters to kilometres, or weight from grams to
kilograms, this program simplifies the task. This project is
designed using Python and focuses on applying basic
programming concepts such as conditional statements,
loops, and arithmetic operations. It is an easy-to-use
program for students, professionals, and anyone who needs
quick and accurate conversions.
Explanation of the Project
The Unit Converter program is divided into three
categories:
[Link] Conversion: Converts between Celsius
and Fahrenheit.
[Link] Conversion: Converts between meters and
kilometres.
[Link] Conversion: Converts between grams and
kilograms.
The user selects the desired category and follows the
prompts to input the value to be converted. Based on the
input, the program performs the conversion using simple
arithmetic formulas and displays the result. The program
also handles invalid inputs to ensure a user-friendly
experience.
Source Code
def temperature_converter():
print("1. Celsius to Fahrenheit")
print("2. Fahrenheit to Celsius")
choice = int(input("Choose an option (1 or 2): "))
if choice == 1:
celsius = float(input("Enter temperature in Celsius: "))
fahrenheit = (celsius * 9/5) + 32
print(f"{celsius}°C is equal to {fahrenheit}°F.")
elif choice == 2:
fahrenheit = float(input("Enter temperature in Fahrenheit: "))
celsius = (fahrenheit - 32) * 5/9
print(f"{fahrenheit}°F is equal to {celsius}°C.")
else:
print("Invalid choice!")
def length_converter():
print("1. Meters to Kilometers")
print("2. Kilometers to Meters")
choice = int(input("Choose an option (1 or 2): "))
if choice == 1:
meters = float(input("Enter length in meters: "))
kilometers = meters / 1000
print(f"{meters} meters is equal to {kilometers} kilometers.")
elif choice == 2:
kilometers = float(input("Enter length in kilometers: "))
meters = kilometers * 1000
print(f"{kilometers} kilometers is equal to {meters} meters.")
else:
print("Invalid choice!")
def weight_converter():
print("1. Grams to Kilograms")
print("2. Kilograms to Grams")
choice = int(input("Choose an option (1 or 2): "))
if choice == 1:
grams = float(input("Enter weight in grams: "))
kilograms = grams / 1000
print(f"{grams} grams is equal to {kilograms} kilograms.")
elif choice == 2:
kilograms = float(input("Enter weight in kilograms: "))
grams = kilograms * 1000
print(f"{kilograms} kilograms is equal to {grams} grams.")
else:
print("Invalid choice!")
# Main program
print("Unit Converter")
print("1. Temperature")
print("2. Length")
print("3. Weight")
main_choice = int(input("Choose a category (1, 2, or 3): "))
if main_choice == 1:
temperature_converter()
elif main_choice == 2:
length_converter()
elif main_choice == 3:
weight_converter()
else:
print("Invalid choice!")
Output
Applications
[Link]: Students can use the program to perform
conversions quickly during study sessions or
assignments.
[Link] Life: Helpful for people in everyday scenarios,
such as converting weights while shopping or
converting temperatures when traveling.
[Link] and Research: Scientists and researchers can
use it to convert units while conducting experiments.
[Link]: Engineers often need unit conversions
while designing systems or solving problems.
[Link]: Useful in industries like logistics and
manufacturing for measuring and converting units
efficiently.
Future Scope
Unit converters play a crucial role in various fields, and
their importance will continue to grow as global
connectivity and technology advance.
They are essential in scientific research for accurate data
interpretation and analysis across different measurement
systems. With globalization, unit converters are
increasingly valuable for international trade. Additionally,
in healthcare, unit converters assist in dosage calculations
and medical measurements.
The expanding scope of automation and artificial
intelligence also relies on accurate unit conversions for
seamless operation of systems, making unit converters
indispensable in a technology-driven future.
Bibliography
Computer Science with Python by Preeti Arora Class
XI (Book)
[Link]
[Link]