0% found this document useful (0 votes)
2 views

Computer Science Project

The document outlines a Computer Science project titled 'Scientific Calculator' completed by Prateek Singh Negi at PM SHRI Kendriya Vidyalaya No.2. It includes a certificate of completion, acknowledgments, and details on the project’s purpose, feasibility study, historical context, source code, and conclusions. The project aims to create a menu-driven Python program that simulates a scientific calculator, enhancing programming and mathematical skills.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Computer Science Project

The document outlines a Computer Science project titled 'Scientific Calculator' completed by Prateek Singh Negi at PM SHRI Kendriya Vidyalaya No.2. It includes a certificate of completion, acknowledgments, and details on the project’s purpose, feasibility study, historical context, source code, and conclusions. The project aims to create a menu-driven Python program that simulates a scientific calculator, enhancing programming and mathematical skills.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 28

COMPUTER SCIENCE PROJECT

2024-25

PM SHRI Kendriya Vidyalaya No.2,


Army,Vadodara
Project name
SCIENTIFIC CALCULATOR

Submitted by:
Prateek Singh Negi (XI-A)
Certificate

This is to certify that Prateek Singh Negi, student of Class XI A, PM

SHRI Kendriya Vidyalaya No. 2 ARMY Baroda has satisfactorily

completed his Computer Science project titled “Scientific

Calculator” as prescribed by the course during the academic year

2024-25 toward partial fulfillment of credit for the computer

practical evaluation, and submitted a satisfactory report, as

compiled in the following pages, under my supervision.

Sh. Ashish Jain


Computer Science
PM SHRI K.V. No.2 ARMY Baroda

Submitted by:
Prateek Singh Negi (XI-A)
Acknowledgment

First and foremost, I would like to express my sincere gratitude to my teacher,


Sh. Ashish Jain, who gave me the opportunity to do my project on the title
’Scientific Calculator’ and without whom this project would not have come
forth. I sincerely thank him for his valuable guidance, support, and
supervision throughout the project.

I would also like to place on record my sincere gratitude to one and all who
supported and encouraged us in completing the project.

Last but not least, I am immensely grateful to my parents and my cousin,


who were with me all the time to encourage and support me.

Thank You Very Much

Submitted by:
Prateek Singh Negi (XI-A)
Contents

Sl. No. Topic Page No.

1 Certificate 02

2 Acknowledgement 03

3 Introduction 05

4 Information Gathering 06

5 Feasibility Study 08

6 History of Scientific Calculator 11

7 Analysis 17

8 Source Code 19

9 Output 24

10 Conclusions 27

11 References / Bibliography 28

Submitted by:
Prateek Singh Negi (XI-A)
Introduction

What is a Scientific Calculator?

 A scientific calculator is a type of electronic calculator


designed to handle complex mathematical functions
beyond basic arithmetic.
 It supports operations such as trigonometry, logarithms,
and exponentiation, making it essential for students,
engineers, and scientists.
Importance of a Scientific Calculator

 Used in various fields including mathematics, physics,


engineering, and finance.
 Provides quick and accurate computations for complex
equations.
 Enhances problem-solving efficiency and reduces
manual calculation errors.
Purpose of the Project

 Create a menu-driven Python program to simulate a


scientific calculator.
 Enhance programming and mathematical skills.
 Provide users with a command-line interface for
performing advanced calculations.
 Writing effective procedural code to solve small
to medium sized problems.

Submitted by:
Prateek Singh Negi (XI-A)
Information Gathering
What is 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.
 Widely used in web development, data science, artificial
intelligence, automation, and more.
Key Features of Python

 Easy to Learn and Use: Simple syntax similar to the


English language.
 Extensive Libraries: Includes built-in modules for
mathematics, data handling, and machine learning.
 Cross-Platform Compatibility: Runs on various
operating systems like Windows, macOS, and Linux.
 Strong Community Support: Large developer
community with extensive documentation and forums.
Why Use Python for This Project?

 its library covers many aspects of


mathematics, including algebra, combinatorics,
numerical mathematics, number theory, and
calculus.
 Allows for quick prototyping and development.
 Ensures flexibility in expanding the project with
additional features in the future.

Submitted by:
Prateek Singh Negi (XI-A)
System Development Life Cycle (SDLC)
What is SDLC?
 SDLC (Software Development Life Cycle) is a structured approach to software
development.
 It consists of multiple phases that ensure the project is systematically developed and
maintained.

Phases of SDLC

1. Planning: The new system requirements are


defined. In particular, the deficiencies in the
existing system must be addressed with
specific proposals for improvement
2. Requirement Analysis: Gather and document user needs
and expectations.
3. Design: The proposed system is designed.
Plans are laid out concerning the physical
construction, hardware, operating systems,
programming, communications and security
issues.
4. Development: The new system is developed.
The new components and programs must be
obtained and installed. Users of the system
must be trained in its use.
5. Testing: Validate the functionality, correctness, and
performance of the calculator. All aspects of
performance must be tested. If necessary,
adjustments must be made at this stage. Tests
performed may include systems integration
and system testing.
6. Deployment: Release the software for user accessin a
production environment..
Submitted by:
Prateek Singh Negi (XI-A)
7. Maintenance: Fix bugs, update features, and enhance
performance. Hardware or software may need to
be upgraded, replaced or changed in some way
to better fit the needs of the end-users
continuously

Submitted by:
Prateek Singh Negi (XI-A)
Feasibility Study

1.Technical feasibility:
The Scientific Calculator holds grips of strengths
of Python, a highly versatile, widely-used, and beginner-
friendly programming language. Python is equipped with
a sizeable standard library, including the math module,
which provides robust and pre-built functionality for
advanced mathematical operations like trigonometric
functions, logarithms, and exponents, solving the need
for writing complicated algorithms from scratch and
making the development process efficient and error-free.
Moreover, the syntax is simple, allowing even newbie
programmers to contribute effectively to the project. The
project can be viewed and be implemented on any device
that supports Python, including Windows, macOS, and
Linux systems, ensuring platform independence.

2. Economic Feasibility:
The project is mostly cost-effective as it uses
entirely the free and open-source software.
Python, the primary tool used, is freely available
for download and usage without any fees. Not
requiring any third party apps or libraries makes
the financial pressur negligible. A standard
computer system with Python installed is sufficient
Submitted by:
Prateek Singh Negi (XI-A)
to develop, test, and run the application. This low-
cost setup makes the project accessible to
students and institutions, even those with limited
resources.

3.Operational Feasibility:

 Menu driven interface


 Easy to Use
 Guidance through each step
 Not requiring any major expertise
 Seemless execution
 Meets evolving needs of the generation

Submitted by:
Prateek Singh Negi (XI-A)
HISTORY OF SCIENTIFIC
CALCULATORS

Early Calculating Machines (Pre-Scientific Calculators)


1. Abacus (c. 2400 BCE): One of the earliest calculating tools,
primarily used for arithmetic calculations.
2. Pascaline (1642): Blaise Pascal created this mechanical
calculator capable of performing addition and subtraction. It was
a precursor to later machines and showed the potential for
automating calculations.
3. Leibniz's Step Reckoner (1673): Gottfried Wilhelm Leibniz
developed a machine that could perform addition, subtraction,
multiplication, and division.

The Arrival of Electronic Calculators (Mid-20th Century)


1. First Electronic Calculators (1960s): Early calculators were
large, expensive, and primarily used for basic arithmetic. These
machines were developed based on vacuum tube technology.
2. Introduction of Transistors (1960s): The use of transistors
made electronic calculators more compact and affordable. These
were the first pocket-sized devices.
3. Introduction of Scientific Calculators (1970s):
o Texas Instruments TI-30 (1976): One of the first widely
available scientific calculators, the TI-30 featured a range
of functions including basic arithmetic, square roots,
trigonometric functions, and logarithms.
o Sharp EL-5100 (1977): This model by Sharp added more
complex scientific functions, such as trigonometric and
exponential calculations, making it a major step in the
development of scientific calculators.

Submitted by:
Prateek Singh Negi (XI-A)
The incoming of Digital and Graphing Calculators (1980s
- 1990s)
1. Graphing Calculators (1985): The first true graphing
calculators, like the TI-81 released by Texas Instruments in
1990, allowed users to plot graphs and perform advanced
calculations. These calculators became a valuable tool for higher
education, particularly in subjects like calculus, physics, and
engineering.
2. CASIO fx-7000G (1985): Casio introduced the world's first
graphing calculator, which was capable of plotting graphs and
performing complex mathematical operations.
3. TI-83 (1996): A major leap in calculator technology, this model
became widely used in high schools and colleges for
mathematics and science courses due to its ease of use and
extensive functionality.

Modern Developments (2000s - Present)


1. More Advanced Graphing Calculators (2000s): The TI-
Nspire series and Casio’s fx-9860G+ offered higher processing
power, color displays, and the ability to store more data and
perform more complex simulations.
2. Integration with Computer Software: Many scientific
calculators, especially graphing models, began to integrate with
software like MATLAB or GeoGebra, enhancing their utility for
professional and educational purposes.
3. Scientific Calculators on Smartphones (2010s): With the
advent of smartphones, scientific calculator applications became
widely available, offering advanced functions without needing a
physical calculator.

Submitted by:
Prateek Singh Negi (XI-A)
Key Features of Modern Scientific Calculators:
 Trigonometric Functions: Sine, cosine, tangent, and
their inverses.
 Exponential and Logarithmic Functions: Natural
logarithms, logarithms base 10, and exponents.
 Complex Number Calculations: Calculating with
imaginary numbers.
 Graphing Capabilities: Displaying graphs of functions.
 Programming: Some models allow basic programming
for custom functions.
 Data Storage: Storing equations, variables, and
formulas.

Some Images of the above scientific


Calculators

Abacus

Submitted by:
Prateek Singh Negi (XI-A)
Pascaline

Leibniz's Step Reckoner

Submitted by:
Prateek Singh Negi (XI-A)
Transistor

Submitted by:
Prateek Singh Negi (XI-A)
Mexican Instrument

Submitted by:
Prateek Singh Negi (XI-A)
Analysis
1.Flexibility:
 Wide range of operations
 Basic maths like addition, subtraction etc. as well as
complex and advance problems such as trigonometric
functions, logarithms, square roots, and
exponentiation.
 Meets diverse user requirements to give maximum
output and satisfaction
 Can be for everyday use

2. Ease of use:
 a menu-driven interface
 simplifies user interaction.
 Easy navigation
 even beginners with minimal programming or
mathematical experience can use the calculator
without confusion or difficulty.

3.Challenges:
a) Input Validation:
One of the key challenges is ensuring that users provide
valid inputs for each operation. For example, if the user
inputs a non-numeric value when a numeric one is expected,
or specifies an invalid base for logarithmic functions, the
program needs to handle such scenarios gracefully.

Submitted by:
Prateek Singh Negi (XI-A)
b) Error Handling :
 Division by zero should not be allowed and should be
displayed with a proper error message.
 Trigonometric functions, may encounter issues for
certain angles where the tangent is undefined.
Effective error-handling strategies are critical to ensure
the calculator remains user-friendly and provides
meaningful feedback in such cases.

Submitted by:
Prateek Singh Negi (XI-A)
Source Code
import math

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


if b == 0:
return "Error! Division by zero."
return a / b

def power(base, exp):


return math.pow(base, exp)

def square_root(num):
if num < 0:
Submitted by:
Prateek Singh Negi (XI-A)
return "Error! Cannot calculate the square root of a
negative number."
return math.sqrt(num)

def sine(angle):
return math.sin(math.radians(angle))

def cosine(angle):
return math.cos(math.radians(angle))

def tangent(angle):
return math.tan(math.radians(angle))

def natural_log(num):
if num <= 0:
return "Error! Logarithm undefined for non-positive
numbers."
return math.log(num)

def log_base_10(num):
if num <= 0:

Submitted by:
Prateek Singh Negi (XI-A)
return "Error! Logarithm undefined for non-positive
numbers."
return math.log10(num)

def calculator():
while True:
print("\nScientific Calculator")
print("1. Addition")
print("2. Subtraction")
print("3. Multiplication")
print("4. Division")
print("5. Power")
print("6. Square Root")
print("7. Sine")
print("8. Cosine")
print("9. Tangent")
print("10. Natural Logarithm")
print("11. Log Base 10")
print("12. Exit")

choice = input("Select an operation (1-12): ")


if choice == '12':
Submitted by:
Prateek Singh Negi (XI-A)
print("Exiting the calculator. Goodbye!")
break

if choice in ['1', '2', '3', '4', '5']:


num1 = float(input("Enter first number: "))
num2 = float(input("Enter second number: "))
if choice == '1':
print(f"Result: {add(num1, num2)}")
elif choice == '2':
print(f"Result: {subtract(num1, num2)}")
elif choice == '3':
print(f"Result: {multiply(num1, num2)}")
elif choice == '4':
print(f"Result: {divide(num1, num2)}")
elif choice == '5':
print(f"Result: {power(num1, num2)}")
elif choice == '6':
num = float(input("Enter a number: "))
print(f"Result: {square_root(num)}")
elif choice in ['7', '8', '9']:
angle = float(input("Enter angle in degrees: "))
if choice == '7':
Submitted by:
Prateek Singh Negi (XI-A)
print(f"Result: {sine(angle)}")
elif choice == '8':
print(f"Result: {cosine(angle)}")
elif choice == '9':
print(f"Result: {tangent(angle)}")
elif choice == '10':
num = float(input("Enter a number: "))
print(f"Result: {natural_log(num)}")
elif choice == '11':
num = float(input("Enter a number: "))
print(f"Result: {log_base_10(num)}")
else:
print("Invalid choice! Please select a valid option.")

# Run the calculator


if __name__ == "__main__":
calculator()

Submitted by:
Prateek Singh Negi (XI-A)
Output

Submitted by:
Prateek Singh Negi (XI-A)
Submitted by:
Prateek Singh Negi (XI-A)
Submitted by:
Prateek Singh Negi (XI-A)
Conclusion
1.The key takeaways of this project are the following:
 The project demonstrates the use of Python for
real-world applications.
 Reinforces concepts of functions, loops, and error
handling.
 Offers a foundation for creating more advanced
calculators or mathematical tools.
2.What more can be done to enhance and
upgrade the project:
 Add graphical user interface (GUI) using
libraries like Tkinter or PyQt.
 Include more advanced mathematical
functions.

Submitted by:
Prateek Singh Negi (XI-A)
References:
 Coded with the help of family
member
 Wikipedia
 Internet websites

Submitted by:
Prateek Singh Negi (XI-A)

You might also like