python-microproject (1) (2)
python-microproject (1) (2)
ON
( COMPUTER ENGINEERING )
SUBMITTED TO
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION,
MUMBAI
SUBMITTED BY
CERTIFICATE
This is to certify that the project report entitled “ Simple Calculator
System’’ Was successfully completed by Student of third semester Diploma in
Computer engineering.
groups members.
Bhor Pranav Balu
1.
Bhor Pranav Balu
Ms.Khandekr.P.P
(Name & Signature of Faculty)
INDEX
1. Abstract 2
2. Introduction 3
3. Literature Survey 6
4. ER Diagram 7
5. Implementation 8
6. Output 10
7. Conclusions 12
8. References 13
1|P a g e
1. Abstract
2|P a g e
2. Introduction
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)
Attributes:
3|P a g e
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.
...
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:
4|P a g e
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.
5|P a g e
3. Literature Survey
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.
6|P a g e
4. ER Diagram
7|P a g e
5. Implementation
class Calculator:
def addition(self):
print(a + b)
def subtraction(self):
print(a - b)
def multiplication(self):
print(a * b)
def division(self):
print(a / b)
obj = Calculator()
choice = 1
while choice
!= 0:
8|P a g e
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|P a g e
6. Output
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
10 | P a g e
1. ADDITION
2. SUBTRACTION
3. MULTIPLICATION 4. DIVISION
Enter your choice:4
5
7. Conclusion
12 | P a g e
8. References
Books:
Websites:
https://www.w3schools.com/python/
https://www.tutorialspoint.com/python/.py
https://www.codingninjas.com/
https://www.zapmeta.co.in/