Python 2334
Python 2334
Python 2334
Mumbai. (M.S.)
MICRO PROJECT
On
“Scientific calculator using python”
Submitted by
Isha Sandip Mohite
Rutuja Maroti Waghchaure
G.S. Mandal’s
56 RutujaMarotiWaghcahure 2000660237
Date:
Principal
2
INDEX
Annexure-IV Micro Project Teacher Evaluation Sheet
3.0 Proposed Methodology (procedure in brief that will be followed to do the micro-project in
about 100-200 words.)
4.0 Action Plan (Sequence and time required for major activity.)
5.0 Resources required (major resources such as row material, some machining facility,
software etc.)
3.0 Course Outcomes Achieved (Add to the earlier list is more Cos are addressed)
5.0 Actual Methodology Followed (Write step wise work done, data collected and its
analysis (if any). The contribution of individual member may also be noted.)
7.0 Outputs of the micro projects (Drawings of the prototype, drawing of survey, presentation
of collected data, findings etc.)
3
Annexure-IV
Micro Project
(Teacher Evaluation Sheet)
Signature of Teacher :
4
Annexure-I
Micro-Project Proposal
(Format for Micro-Project Proposal About 1-2 pages)
Before the advent of scientific calculators, most math classes involved a heavy degree of long-
form pen-and-pencil arithmetic, algebraic equations and a lot of rote memorization.
Traditionally, this repetitive practice of recording and manipulating the same formulas over and
over again was considered the best foundation for a future in math. Students who excelled at
these monotonous processes where thought to be mathematically inclined, while those who grew
bored or disinterested were considered to be ill-suited to the subject.
When it came to these rote functions in math, scientific calculators provided a quick, easy,
accurate alternative. That allowed students to come up with the right answers, faster than even
the most seasoned mental arithmetician could. Where students once spent most of their time
copying down long charts of questions and answers, they could now focus on the concepts that
these formulae demonstrated.
5
3.0 Proposed Methodology (Procedure in brief that will be following to do the micro-
project in about 50-100 words.)
A)-For micro-project first we have to decide topic related to Programming with python
subject.
E)-Then we have resarched lot of information and watched video then we were be startingmy
main project.
F)-At the time of project if we have getting some problem then we were ask to the respective
G)- After completing project, we were show it to subject teacher for checking/correction.
6
3.0 Action Plan (Sequence and time required for major activity.)
microproject
notebook
submitting
7
5.0 Resources required (major resources such as row material, some machining
facility, software etc.)
Sr. Name of Resource/Material Specification Qty. Remarks
No
1 Laptop i-5,4 GB RAM 1
3 Microsoft Word - 1
8
Annexure-II
Micro-Project Report
(Format for Micro-Project Report minimum 4 pages)
A scientific calculator is an electronic device that performs the basic arithmetic operations
(addition, subtraction, multiplication and division). In mathematics, a scientific calculator is a
valuable and useful tool as it allows the user to quickly and easily solve more difficult equations
larger than one or two terms.
Equations with a scientific calculator are commonly used in mathematics, physics and other
sciences. In fact, even some calculators created for mathematics can solve equations that contain
roots or indefinite.
In more advanced mathematics, a scientific calculator can be of great help in solving complex
problems where the steps required to solve them manually would be too time consuming, tedious
and inaccurate.
A scientific calculator is also used as a tool to check solutions to more complicated problems. In
high school, a scientific calculator can be used in different ways:
A scientific calculator is important in mathematics for all these reasons. It can do much more
than a normal calculator and makes the process of learning math much easier. In fact, high
school math students are constantly required to make use of it to solve problems. It is most
commonly used in trigonometry, calculus and statistics:
9
2.0) Aim/Benefits of Micro Project:
3.0) Course Outcomes Achieved (Add to the earlier list is more Cos are addressed)
10
4.0) Literature Review:-
https://ieeexplore.ieee.org/document/475332
Abstract:
Calculators are part and parcel of modern education. Involvement of science and engineering in
different fields of knowledge is increasing with each bit of time is passed by, and they are
playing a role in description and characterization of the delicate phenomena of nature arising day
by day. These fields of knowledge and mathematics in particular, are influencing even those
distant branches of knowledge, which were so far imagined to be free of mathematics. Even art is
not free of mathematics and there exists mathematical art. Computations are getting lengthy and
complex specially in design and analysis of engineering systems. Scientific calculators are handy
tools. But an efficient computation is a skill that can be developed. This paper describes the
Calculator Project, which was a three-year joint research project between the Centre for
Information Technology in Education at The Open University, U.K. and the Department of
Computer Science, QMW, University of London, U.K.. The project was funded by the U.K.
Joint Council Initiative in Cognitive Science and Human-Computer Interaction. The central aim
of the project was to test the hypothesis that providing so-called calculators would improve
students performance in those parts of the undergraduate first-year that relied on formal
reasoning skills.
Print ISBN:0-8186-5870-3
DOI: 10.1109/SEDC.1994.475332
Publisher: IEEE
11
5.0 Actual Methodology Followed (Write step wise work done, data collected and its analysis
(if any).The contribution of individual member may also be noted.)
At the beginning we were confused about selecting Topic for Programming with Python
Subject microproject but after a conversation with subject teacher we made my decision and
select topic Scientific Calculator Using Python.
.
B) Searching and Collecting Information :
After selecting project topic then we searched lots of information related to Online Digital Notice
Board .we were visited more than 5 websites which gave me valuable information about my
Project topic.
C) Raw Project :
As we were not able to proceed further in micro project we don’t brief discussion with respected
subjectteacher (Prof.P.J.Chaoudhari.) ,During conversation mam gave me proper instruction and
Sequence for project.
After removing errors we have completed my project and got the proper output.
12
6.0 Actual Resources Used (mention the actual resources used).
7 https://www.thoughtco.com/how-to-use-a-scientific- Website
calculator-4088420
13
7.0 Outputs of the micro projects (Drawings of the prototype, drawing of survey,
Presentation of collected data, findings etc.)
14
8.0 Skill Developed/Learning outcome of this micro project
15
Introduction:-
1. The mathematical problem which has to be solved should be typed in the calculator using
correct syntax.
2. The direction of keys on the calculator should be kept as same as the direction on a standard
calculator.
3. The input key of the scientific calculator has to be pressed first, followed by the mathematical
operator key.
4. Wrong input should be checked thoroughly before getting started on a problem, since this can
lead to wrong calculation.
6. Different types of storage functions are available on a calculator such as memory and register.
7. A scientific calculator can also be used to solve problems related to geometry, algebra and
trigonometry.
Scientific calculators can be used for general purpose to solve problems related to operations,
roots and fractions. This type of calculator is useful when a problem requires a number of steps
to be performed.In mathematics, a scientific calculator can be used to solve problems related to
square roots and other roots, operations with fractions and polynomials, algebraic expressions
and other types of functions.These calculators can be used to solve problems related to
logarithms, trigonometric equations and exponential functions.
16
Python Tkinter − Tkinter is the Python interface to the Tk GUI toolkit shipped with Python.
Tkinter is the standard GUI library for Python. Python when combined with Tkinter
provides a fast and easy way to create GUI applications. Tkinter provides a powerful
object-oriented interface to the Tk GUI toolkit.
Creating a GUI application using Tkinter is an easy task. All you need to do is perform
the following steps −
• Import the Tkinter module.
• Create the GUI application main window.
• Add one or more of the above-mentioned widgets to the GUI application.
• Enter the main event loop to take action against each event triggered by the
user.
•
Example
#!/usr/bin/python
import Tkinter
top = Tkinter.Tk()
# Code to add widgets will go here...
top.mainloop()
17
Tkinter Widgets
Tkinter provides various controls, such as buttons, labels and text boxes used in a GUI
application. These controls are commonly called widgets.
1 Button
2 Canvas
The Canvas widget is used to draw shapes, such as lines, ovals, polygons and
rectangles, in your application.
3 Checkbutton
The Checkbutton widget is used to display a number of options as checkboxes. The user
can select multiple options at a time.
4 Entry
The Entry widget is used to display a single-line text field for accepting values from a
user.
5 Frame
The Frame widget is used as a container widget to organize other widgets.
6 Label
The Label widget is used to provide a single-line caption for other widgets. It can also
contain images.
7 Listbox
The Listbox widget is used to provide a list of options to a user.
8 Menubutton
The Menubutton widget is used to display menus in your application.
9 Menu
The Menu widget is used to provide various commands to a user.
18
10 Message
The Message widget is used to display multiline text fields for accepting values from a
user.
11 Radiobutton
The Radiobutton widget is used to display a number of options as radio buttons. The
user can select only one option at a time.
12 Scale
The Scale widget is used to provide a slider widget.
13 Scrollbar
The Scrollbar widget is used to add scrolling capability to various widgets, such as list
boxes.
14 Text
The Text widget is used to display text in multiple lines.
15 Toplevel
The Toplevel widget is used to provide a separate window container.
16 Spinbox
The Spinbox widget is a variant of the standard Tkinter Entry widget, which can be used
to select from a fixed number of values.
17 PanedWindow
A PanedWindow is a container widget that may contain any number of panes, arranged
horizontally or vertically.
18 LabelFrame
A labelframe is a simple container widget. Its primary purpose is to act as a spacer or
container for complex window layouts.
19 tkMessageBox
This module is used to display message boxes in your applications.
19
Program Code Of Scientific Calculator
root = Tk()
root.title("Scientific Calculator")
root.configure(background = 'white')
root.resizable(width=False, height=False)
root.geometry("480x568+450+90")
calc = Frame(root)
calc.grid()
class Calc():
def init (self):
self.total=0
self.current=''
self.input_value=True
self.check_sum=False
self.op=''
self.result=False
def sum_of_total(self):
self.result=True
self.current=float(self.current)
if self.check_sum==True:
20
self.valid_function()
else:
self.total=float(txtDisplay.get())
def valid_function(self):
if self.op == "add":
self.total += self.current
if self.op == "sub":
self.total -= self.current
if self.op == "multi":
self.total *= self.current
if self.op == "divide":
self.total /= self.current
if self.op == "mod":
self.total %= self.current
self.input_value=True
self.check_sum=False
self.display(self.total)
def Clear_Entry(self):
self.result = False
self.current = "0"
self.display(0)
self.input_value=True
def All_Clear_Entry(self):
self.Clear_Entry()
self.total=0
def pi(self):
21
self.result = False
self.current = math.pi
self.display(self.current)
def tau(self):
self.result = False
self.current = math.tau
self.display(self.current)
def e(self):
self.result = False
self.current = math.e
self.display(self.current)
def mathPM(self):
self.result = False
self.current = -(float(txtDisplay.get()))
self.display(self.current)
def squared(self):
self.result = False
self.current = math.sqrt(float(txtDisplay.get()))
self.display(self.current)
def cos(self):
self.result = False
self.current = math.cos(math.radians(float(txtDisplay.get())))
self.display(self.current)
def cosh(self):
self.result = False
self.current = math.cosh(math.radians(float(txtDisplay.get())))
self.display(self.current)
def tan(self):
self.result = False
self.current = math.tan(math.radians(float(txtDisplay.get())))
self.display(self.current)
def tanh(self):
self.result = False
self.current = math.tanh(math.radians(float(txtDisplay.get())))
self.display(self.current)
def sin(self):
22
self.result = False
self.current = math.sin(math.radians(float(txtDisplay.get())))
self.display(self.current)
def sinh(self):
self.result = False
self.current = math.sinh(math.radians(float(txtDisplay.get())))
self.display(self.current)
def log(self):
self.result = False
self.current = math.log(float(txtDisplay.get()))
self.display(self.current)
def exp(self):
self.result = False
self.current = math.exp(float(txtDisplay.get()))
self.display(self.current)
def acosh(self):
self.result = False
self.current = math.acosh(float(txtDisplay.get()))
self.display(self.current)
def asinh(self):
self.result = False
self.current = math.asinh(float(txtDisplay.get()))
self.display(self.current)
def expm1(self):
self.result = False
self.current = math.expm1(float(txtDisplay.get()))
self.display(self.current)
def lgamma(self):
self.result = False
self.current = math.lgamma(float(txtDisplay.get()))
self.display(self.current)
def degrees(self):
self.result = False
self.current = math.degrees(float(txtDisplay.get()))
self.display(self.current)
def log2(self):
23
self.result = False
self.current = math.log2(float(txtDisplay.get()))
self.display(self.current)
def log10(self):
self.result = False
self.current = math.log10(float(txtDisplay.get()))
self.display(self.current)
def log1p(self):
self.result = False
self.current = math.log1p(float(txtDisplay.get()))
self.display(self.current)
added_value = Calc()
numberpad = "789456123"
i=0
btn = []
for j in range(2,5):
for k in range(3):
btn.append(Button(calc, width=6, height=2,
bg='black',fg='white',
font=('Helvetica',20,'bold'),
bd=4,text=numberpad[i]))
btn[i].grid(row=j, column= k, pady = 1)
btn[i]["command"]=lambda x=numberpad[i]:added_value.numberEnter(x)
i+=1
24
bd=4,
command=added_value.All_Clear_Entry
).grid(row=1, column= 1, pady = 1)
25
btnPM = Button(calc, text=chr(177),width=6,
height=2,bg='powder blue', font=('Helvetica',20,'bold'),
bd=4,command=added_value.mathPM
).grid(row=5, column= 2, pady = 1)
# ROW 2 :
btn2Pi = Button(calc, text="2pi",width=6,
height=2,bg='black',fg='white',
font=('Helvetica',20,'bold'),
bd=4,command=added_value.tau
).grid(row=2, column= 4, pady = 1)
26
bd=4,command=added_value.cosh
).grid(row=2, column= 5, pady = 1)
# ROW 3 :
btnlog = Button(calc, text="log",width=6,
height=2,bg='black',fg='white',
font=('Helvetica',20,'bold'),
bd=4,command=added_value.log
).grid(row=3, column= 4, pady = 1)
# ROW 4 :
btnlog10 = Button(calc, text="log10",width=6,
height=2,bg='black',fg='white',
font=('Helvetica',20,'bold'),
bd=4,command=added_value.log10
27
).grid(row=4, column= 4, pady = 1)
28
font=('Helvetica',30,'bold'),
bg='black',fg='white',justify=CENTER)
def iExit():
iExit = tkinter.messagebox.askyesno("Scientific Calculator",
"Do you want to exit ?")
if iExit>0:
root.destroy()
return
def Scientific():
root.resizable(width=False, height=False)
root.geometry("944x568+0+0")
def Standard():
root.resizable(width=False, height=False)
root.geometry("480x568+0+0")
menubar = Menu(calc)
# ManuBar 1 :
filemenu = Menu(menubar, tearoff = 0)
menubar.add_cascade(label = 'File', menu = filemenu)
filemenu.add_command(label = "Standard", command = Standard)
filemenu.add_command(label = "Scientific", command = Scientific)
filemenu.add_separator()
filemenu.add_command(label = "Exit", command = iExit)
# ManuBar 2 :
editmenu = Menu(menubar, tearoff = 0)
menubar.add_cascade(label = 'Edit', menu = editmenu)
editmenu.add_command(label = "Cut")
editmenu.add_command(label = "Copy")
editmenu.add_separator()
editmenu.add_command(label = "Paste")
root.config(menu=menubar)
root.mainloop()
29
Output Of The Above Program
Standard Calculator
30
Scientific Calculator
31