0% found this document useful (0 votes)
19 views21 pages

Ip Project Rihan

The document outlines a Python program that functions as a multi-functional calculator, allowing users to perform operations such as percentage calculation, simple interest calculation, and basic arithmetic operations. It includes a user interface for selecting operations and inputting values, along with acknowledgments for support received during the project. Additionally, it features an introduction to Python, its key attributes, and an ER diagram representing user interactions with the system.
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)
19 views21 pages

Ip Project Rihan

The document outlines a Python program that functions as a multi-functional calculator, allowing users to perform operations such as percentage calculation, simple interest calculation, and basic arithmetic operations. It includes a user interface for selecting operations and inputting values, along with acknowledgments for support received during the project. Additionally, it features an introduction to Python, its key attributes, and an ER diagram representing user interactions with the system.
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/ 21

def calculate_percentage(total_marks,

obtained_marks):
return (obtained_marks /
total_marks) * 100

def calculate_simple_interest(principal,
rate, time):
return (principal * rate * time) / 100

def add(a, b):


return a + b

def subtract(a, b):


return a - b

def multiply(a, b):


return a * b
def divide(a, b):
return a / b if b != 0 else "Cannot
divide by zero"

def main():
while True:
print("\nChoose an option:")
print("1. Calculate Percentage")
print("2. Calculate Simple
Interest")
print("3. Addition")
print("4. Subtraction")
print("5. Multiplication")
print("6. Division")
print("7. Exit")
choice = input("Enter your choice
(1-7): ")

if choice == '1':
total = float(input("Enter total
marks: "))
obtained = float(input("Enter
obtained marks: "))
percentage =
calculate_percentage(total, obtained)
print(f"Percentage:
{percentage:.2f}%")

elif choice == '2':


principal = float(input("Enter
principal amount: "))
rate = float(input("Enter rate of
interest (per annum): "))
time = float(input("Enter time
(in years): "))
interest =
calculate_simple_interest(principal,
rate, time)
print(f"Simple Interest:
{interest:.2f}")

elif choice == '3':


a = float(input("Enter first
number: "))
b = float(input("Enter second
number: "))
print(f"Addition: {add(a, b)}")

elif choice == '4':


a = float(input("Enter first
number: "))
b = float(input("Enter second
number: "))
print(f"Subtraction: {subtract(a,
b)}")
 Percentage Calculation
 Input: total_marks = 500,
obtained_marks = 450
 Output: Percentage: 90.00%
 Simple Interest Calculation
 Input: principal = 1000, rate
= 5, time = 2
 Output: Simple Interest:
100.00
 Addition
 Input: a = 10, b = 5
 Output: Addition: 15.0
 Subtraction
 Input: a = 10, b = 5
 Output: Subtraction: 5.0
 Multiplication
 Input: a = 10, b = 5
 Output: Multiplication: 50.0
 Division
 Input: a = 10, b = 5
 Output: Division: 2.0
 If b = 0, Output: Cannot divide
by zero
elif choice == '5':
a = float(input("Enter first
number: "))
b = float(input("Enter second
number: "))
print(f"Multiplication:
{multiply(a, b)}")

elif choice == '6':


a = float(input("Enter first
number: "))
b = float(input("Enter second
number: "))
print(f"Division: {divide(a, b)}")

elif choice == '7':


print("Exiting program.
Goodbye!")
break

else:
print("Invalid choice! Please try
again.")

if __name__ == "__main__":
main()
ACKNOWLEDGMENT
I would like to express my sincere gratitude to
everyone who has helped me in the successful
completion of this Informatics Practices project.
First and foremost, I would like to thank my
subject teacher, [Miss Garima Singh], for their
invaluable guidance, continuous support, and
encouragement throughout the project. Their
insightful suggestions and expertise in the
subject have greatly contributed to my
understanding and learning.
I also extend my heartfelt thanks to my school,
[Amrita Public School], for providing the
necessary resources and a conducive learning
environment.
I am grateful to my parents and friends for their
unwavering support, motivation, and assistance
during the project. Their encouragement kept me
focused and dedicated.
Lastly, I would like to acknowledge the various
online and offline resources that provided me
with useful information to enhance my project.
This project has been a great learning
experience, and I truly appreciate all the help I
have received.
[Mohd Rihan]
Class 11 – B
[Amrita Public School]
CERTIFICATE
This is to certify that [MOHD RIHAN], a
student of Class 11, Section [B], has
successfully completed the Informatics
Practices project titled "[Project Title]" as
per the requirements of the [CBSE]
curriculum for the academic year [2024-
2025].
The project was carried out under my
guidance and supervision, and it is the
original work of the student.
I appreciate the effort and dedication put
into this project and wish [MOHD RIHAN]
all the best for future endeavors.

Signature of Student
[MOHD RIHAN]
Signature of Teacher
[MISS GARIMA SINGH]
(Informatics Practices Teacher)
Date: [ ]
Place: [AMRITA PUBLIC SCHOOL]
Introduction to Python

Python is a high-level, interpreted


programming language known for its
simplicity and readability. It supports
multiple programming paradigms,
including procedural, object-oriented, and
functional programming. Python is widely
used in web development, data science,
artificial intelligence, automation, and
more.
Key Features of Python:

 Easy to Learn: Python has a simple


syntax that resembles English, making
it beginner-friendly.

 Dynamically Typed: No need to


declare variable types explicitly.
 Interpreted Language: Code is
executed line by line, allowing for
quick debugging.

 Extensive Libraries: Python offers rich


libraries like NumPy, Pandas,
TensorFlow, etc.

 Platform Independent: Code written in


Python can run on various operating
systems.
Introduction to the Program

This program is a multi-functional


calculator that allows users to perform
various mathematical operations. It
provides the following features:

1. Percentage Calculation –
Computes the percentage based on
total and obtained marks.

2. Simple Interest Calculation –


Calculates simple interest based on
principal, rate, and time.

3. Basic Arithmetic Operations:


o Addition – Adds two numbers.
o Subtraction – Subtracts one
number from another.
o Multiplication – Multiplies two
numbers.

o Division – Divides one number


by another, handling division by
zero.
The program is menu-driven, allowing
users to select an operation and input
values accordingly. It runs in a loop
until the user chooses to exit.
Entities and Relationships

1. User (Entity)
o Interacts with the system.
o Selects operations and provides
input values.

2. Operations (Entity)
o Attributes: operation_id,
operation_type
o Relationships:
 A User performs one or
more Operations.

3. Calculations (Entity)
o Attributes:
calculation_id,
input_values, result
o Relationships:
 An Operation generates
one or more Calculations.

ER Diagram Representation
sql
CopyEdit
+-----------+
+------------+
+-------------+
| User |------>|
Operations |------>|
Calculations |
+-----------+
+------------+
+-------------+
|
|
|
| Performs
| Generates
| Stores
v
v
v
(User Input) (Math
Operation
CONTENT
1. INTRODUCTION TO
PYTHON.
2. INTRODUCTION TO
TOPIC.
3. SOURCE CODE
4. ER DIAGRAM
5. OUTPUT
6. BIBLOGRAPHY
BIBLOGRAPHY

1. GOOGLE.COM

2. YOUTUBE

3. (INFORMATICS
PRACTICES)IP BOOK

4. PYTHON

You might also like