You are on page 1of 15

Micro Project

On
Project Title:-Calculator

By
Name :- Sarthak n
Enrollment No: 226040316045

A Micro Project in Python Programming(4311601)


Submitted to

Information Technology Department

January 2023
Table of Contents

1.Introduction
1.1 Arithmetic Operator
1.2 Functions of Arithmetic calculator
1.3 How it is used

2.Softwares for [Arithmetic calculator]


2.1 Anaconda
2.2 Jupyter Notebook
2.3 Python
2.4 Python libraries
2.4.1 Pandas
2.4.2 Matplotlib
2.4.3 Visual studio

3. Flowchart, Algorithm & Pseudo Code


3.1 Flowchart
3.2 Algorithm
3.3 Pseudo Code
Source Code(Python Code)
1. Introduction

1.1 Arithmetic Operator


An arithmetic operator is a mathematical
function that performs a calculation on two
operands.
There are four basic arithmetic operators in
python:-
 Addition (+)
 Subtraction (-)
 Multiplication (*)
 Division (/)

1.2 Function of Arithmetic calculator


There are mainly 5 arithmetic operator are
used to perform mathematical operations like
addition, subtraction, multiplication and
division.
The arithmetic operator for scalars are:
addition (+), subtraction (-), multiplication (*),
division (/), and exponentiation (^). Vector
and matrix calculations can also be organized
in a simple way using these operators. For
example, multiplication of two matrices A and
B is expressed as A. *B.
1.3 How it is use
Arithmetic Operators
Operators:-
(*) :- Multiplication: multiply two values
(/) :- Division: divide one value by another
(+) :- Addition: add two values
(-) :- Subtraction: subtract one values

2. Software for [Arithmetic calculator]

2.1 Anaconda

Anaconda is a distribution of the Python and R


programming languages for scientific computing (data
science, machine learning applications, large-scale data
processing, predictive analytics, etc.), that aims to
simplify package management and deployment. The
distribution includes data-science packages suitable for
Windows, Linux, and macOS. It is developed and
maintained by Anaconda, Inc., which was founded by
Peter Wang and Travis Oliphant in 2012.

2.2 Jupyter Notebook

The Jupyter Notebook is an open-source web


application that allows you to create and share
documents that contain live code, equations,
visualizations and narrative text. Uses include data
cleaning and transformation, numerical simulation,
statistical modeling, data visualization, machine
learning, and much more.Jupyter has support for over
40 different programming languages and Python is one
of them. Python is a requirement (Python 3.3 or
greater, or Python 2.7) for installing the Jupyter
Notebook itself.

2.3 Python

Python is a high-level, general-purpose programming


language. Its design philosophy emphasizes code
readability with the use of significant indentation.
Python is dynamically-typed and garbage-collected. It
supports multiple programming paradigms, including
structured, object-oriented and functional
programming.

2.4 Python Libraries for Data Analytics

A Python library is a reusable chunk of code that you


may want to include in your programs/ projects.
Compared to languages like C++ or C, a Python libraries
do not pertain to any specific context in Python.

2.4.1 Pandas

From importing data from spreadsheets to processing


sets for time-series analysis, Pandas is used for
everything. Pandas pretty much convert one data form
to another on your fingertips. Hence, Pandas powerful
data frames can perform both, basic cleanup and
advance data manipulations.
Pandas is built on one of the earliest libraries is Numpy
(Numerical Python). NumPy’s functions exposure is
used in Pandas for advanced analysis. For more
specialization, one can use Scipy which is scientifically
equivalent to Numpy, offering tools and techniques for
scientific data analysis.

2.4.2 Matplotlib

Python also provides powerful visualization libraries –


Matplotlib. It can be used in all kinds of GUI toolkits
such as python scripts, web applications as well as
shell, etc. With this, we can have the opportunity to
use different types of plots and work with multiple
plots.

2.4.3 Scikit – Learn

Scikit – Learn, one of the attractions of python where


we can implement machine learning. With the support
of simple and efficient tools in this library which can be
used for data analysis and data mining.

2.4.4 TensorFlow

TensorFlow is the most popular tool for Machine


Learning in Python. It was developed specifically for
carrying out deep learning operations. The basic data
structure of TensorFlow ecosystem are the tensors. As
a matter of fact, the name of TensorFlow is derived
from these tensors. TensorFlow is continuously
evolving owing to an open-source community who
have made it a pioneering toolkit for machine learning
operations. It provides support for CPUs, GPUs as well
as TPUs. Due to this, it provides lightning speed
execution speed for various machine learning
algorithms.

TensorFlow has numerous applications. This is mainly


because of its high processing capability. It is used for
the development of speech recognition product,
recommendation systems, Generative Adversarial
Networks, etc. TensorFlow is basically the standardized
tool for performing Deep Learning operations.

2.4.5 Seaborn

For 2D visualization one can use matplotlib & seaborn.


They have many high-level interfaces and styles in
default for drawing statistical graphics.

3.Flowchart, Algorithm & Pseudo Code


3.1 Flowchart
Start

Input op

Input n1,n2

Switch op

Case’+ Print n1, n2, n1+n2

Case’-’ Print n1, n2, n1-n2

Case’* Print n1, n2, n1*n2


Case’/’ Print n1, n2, n1/n2

Print *Error! Operator is not


default
correct*

Stop
3.2 Algorithm
START
Step1: [Enter first number] read num1

Step2: [Enter second number] read num2

Step3: [Enter Choice] read choice

Step4: [To perform addition] if the choice is equal


to plus add num1 and num2 print result.

Step5: [To perform subtraction] if the choice is


equal to minus subtracts num1 and num2 print
result.

Step6: [To perform multiplication] if the choice is


equal to multiplication multiply num1 and num2
print result.

Step7: [To perform division] if the choice is equal


to division divide num1 and num2 print result.

Step8: [To perform Modulus] if the choice is equal


to modulus divide num1 and num2 print result
(remainder)
STOP
3.3 Pseudo Code

Enter The Number a,b,c


apply c an operator such as +,-,*,/,%
if c == "+"
print(a+b)
elif c == "-"
print(a-b)
elif c == "*"
print(a*b)
elif c == "/"
print(a/b)
elif c == "%"
print(a%b)
else
print"invalid choice"
 Source Code
Input:-
a = int(input("Enter a number: "))
b = int(input("Enter a number: "))
c = input("apply any operator such as +,-,/,*,% ")

if c == "+":
print (a + b)
elif c == "-":
print (a - b)
elif c == "*":
print (a * b)
elif c == "/":
print (a / b)
elif c =="%":
print (a % b)
else:
print("invalid choice")
Output:-
Enter a number: 16
Enter a number: 14
apply any operator such as +,-,/,*,%: +
33
Enter a number: 16
Enter a number: 14
apply any operator such as +,-,/,*,%: -
-1

Enter a number: 16
Enter a number: 14
apply any operator such as +,-,/,*,%: /
0.9411764705882353

Enter a number: 16
Enter a number: 14
apply any operator such as +,-,/,*,%: *
272

Enter a number: 16
Enter a number: 14
apply any operator such as +,-,/,*,%: %
16
Refrerences
[1] https://www.javatpoint.com/python-make-
simple-calculator

You might also like