The words you are searching are inside this book. To get more targeted content, please make full-text search by clicking here.

micro-project-simple-calculator-system-python_compress

Discover the best professional documents and content resources in AnyFlip Document Base.
Search
Published by swarajhdeshmukh89, 2022-05-05 05:17:40

micro-project-simple-calculator-system-python_compress

micro-project-simple-calculator-system-python_compress

Project Name : Simple calculator system Academic Year : 2020-2021
Subject Name: Python Semester : Sixth

A STUYDY ON

Simple Calculator System

MICRO PROJECT REPORT

Submitted in June 2021 by the student
Mr. Devendra Nilkanth Thawari

Under the Guidance of

[ Prof. S. S. Morey]

in
Three Years Diploma Program in Engineering & Technology of Maharashtra

State Board of Technical Education, Mumbai (Autonomous) ISO
9001:2008 (ISO/IEC-27001:2013)
at
[ Shri Sai Polytechnic, Chandrapur]

1

MAHARASHTRA STATE BOARD OF TECHNICAL
EDUCATION, MUMBAI

Certificate

This is to certify that Mr. Devendra Nilkanth Thawari

Sixth Semester of Computer Engineering Diploma in Engineering & Technology at [
Shri Sai Polytechnic, Chandrapur] , has completed the Micro Project satisfactorily in
Subject Python in the academic year 2020-2021 as per the MSBTE prescribed curriculum of
I Scheme.

Place:Chandrapur Enrollment No: 1901380449
Date: 24/ 06 / 2021 Exam Seat No: 251171

Project Guide Head of the Department Principal

Head of 2
Institute

INDEX

Sr. Title Page No .

Abstract
1. Introduction
2. Literature Survey
3. ER Diagram
4. Implementation
5. Output
6. Conclusions
7. References

3

Abstract

The simple calculator is a system software which allows us to perform simple mathematical
operations such as addition, substraction , multiplication, division etc. To develop this system we
have used the concept of class and object first we defined the class calculator and defined the
various function inside this class for various mathematical operations and each function is
different from each other. After that we prompted user to provide the input for two numbers. And
at the end of the program we have created the object of calculator class and called all the function
defined inside the class one after one for different tasks as per their respective operations.

Introduction

Python is a widely used general-purpose, high level programming language. It was created by
Guido van Rossum in 1991 and further developed by the Python Software Foundation. It was

4

designed with an emphasis on code readability, and its syntax allows programmers to express
their concepts in fewer lines of code. Python is a programming language that lets you work
quickly and integrate systems more efficiently. Python is a powerful general-purpose
programming language. It is used to develop web applications, data science, creating software
prototypes and so on. Fortunately for beginners, Python has simple easy-to-use syntax. This
makes Python an excellent language to learn to program for beginners.

A class is a code template for creating objects. Objects have member variables and have
behaviour associated with them. In python a class is created by the keyword class.An object is
created using the constructor of the class. This object will then be called the instance of the class.
In Python we create instances in the following manner

Instance = class(arguments)
A class by itself is of no use unless there is some functionality associated with it. Functionalities
are defined by setting attributes, which act as containers for data and functions related to those
attributes. Those functions are called methods.

Attributes:
A class by itself is of no use unless there is some functionality associated with it. Functionalities
are defined by setting attributes, which act as containers for data and functions related to those
attributes. Those functions are called methods.

You can define the following class with the name Snake. This class will have an attribute name.

>>> class Snake:
... name = "python" # set an attribute `name` of the class

...
A function object is created with the def statement. Primarily, we want to evaluate the function
objects we create. However, because a function is an object, it has attributes, and it can be
manipulated to a limited extent.

5

From a syntax point of view, a name followed by ()'s is a function call. You can think of the ()'s
as the "call" operator: they require evaluation of the arguments, then they apply the function.

name ( arguments )

When we use a function name without ()'s, we are talking about the function object. There are a
number of manipulations that you might want to do with a function object.

Call The Function. By far, the most common use for a function object is to call it. When we
follow a function name with ()'s, we are calling the function: evaluating the arguments, and
applying the function. Calling the function is the most common manipulation.

Alias The Function. This is dangerous, because it can make a program obscure. However, it can
also simplify the evoluation and enhancement of software. Imagine that the first version of our
program had two functions named rollDie and rollDice.

By using the above concept we have developed the simple calculator system we have developed
this system we have used the concept of class and object first we defined the class calculator and
defined the various function inside this class for various mathematical operations and each
function is different from each other. After that we prompted user to provide the input for two
numbers. And at the end of the program we have created the object of calculator class and called
all the function defined inside the class one after one for different as per their respective
operations.

Literature Survey

One of my first tasks as a new post-doc was to undertake a systematic quantitative literature
review. We wanted to get a feel for the international & NZ literature on functional biodiversity in
agroecosystems, and this was a bit daunting for me as I my background is in invasions, not native

6

biodiversity or agriculture! Luckily, the review method we chose relies on data, not expert
knowledge - we chose the method developed by Griffith University
(https://www.griffith.edu.au/griffith-sciences/school-environment-
science/research/systematicquantitative-literature-review).
It's quite an exhaustive process but the method does a really good job of catching easily
overlooked papers, and provides a reproducible and transparent method for conducting reviews
and meta-analyses. I'm a fan!

The first few steps involve defining your keywords and databases for undertaking the searches,
and designing a way of storing your papers and extracting the data. Once you've completed the
first 10% of your search, though, you'll need to do a stock-take of the papers that you're picking
up and make sure you haven't missed any key words in your search terms.

It was at this point that I realized two things: a) automating this would save me a lot of time, and
b) there were no existing programs that could do what I wanted. So, I wrote up some python
code to read in all papers, extract the keywords and write them to a new text file. I then used R to
rank them by how commonly they occurred and graph the results, and added any
commonlyoccurring keywords to my database search strings.

ER Diagram

7

Implementation

class Calculator:
def addition(self):

8

print(a + b)

def subtraction(self):
print(a - b)

def multiplication(self):
print(a * b)

def division(self):
print(a / b)

a = int(input("Enter first number:"))
b = int(input("Enter first number:"))

obj = Calculator()

choice = 1 while
choice != 0:

print("1. ADDITION") print("2.
SUBTRACTION") print("3.
MULTIPLICATION") print("4.
DIVISION") choice = int(input("Enter
your choice:")) if choice == 1:
print(obj.addition())
elif choice == 2:

print(obj.subtraction())
elif choice == 3: print(obj.multiplication())
elif choice == 4:

print(obj.division())
else:

print(“ Invalid choice”)

9



Output

Enter first number:3
Enter first number:2
1. ADDITION
2. SUBTRACTION
3. MULTIPLICATION
4. DIVISION
Enter your choice:1
5
1. ADDITION
2. SUBTRACTION
3. MULTIPLICATION
4. DIVISION
Enter your choice:2
1
1. ADDITION
2. SUBTRACTION
3. MULTIPLICATION
4. DIVISION
Enter your choice:3
6
1. ADDITION
2. SUBTRACTION
3. MULTIPLICATION 4. DIVISION
Enter your choice:4
5

10



Conclusion

We have concluded that we have successfully developed a simple calculator system which
perform the various mathematical operations. We have used the concept of class and object to
implement this system and perform a lot of customization so that teachers don’t need to change
anything. We have provide the four functions and each function is responsible for their
respective tasks. This project helps to all the user to perform the mathematical operations very
easily.



References

Books:

1. Python Crash Course
2. Head First Python
3. Learn Python the Hard Way
4. A Byte of Python

Websites:

https://www.w3schools.com/python/
https://www.tutorialspoint.com/python/.py
https://www.codingninjas.com/
https://www.zapmeta.co.in/

12


Click to View FlipBook Version