Sei sulla pagina 1di 12

VISVESVARAYA TECHNOLOGICAL UNIVERSITY

Jnana Sangama, Belagavi – 590018

A Mini Project Report On


“ Advanced Scientific Calculator”
Submitted in Partial Fulfillment of the Requirements for
“Python Application and Programming (15IS665)”
For the Award of Degree in
BACHELOR OF ENGINEERING
IN
INFORMATION SCIENCE AND ENGINEERING
Submitted by
ASHISH ACHARYA(1RI16IS008)
SHAILESH MAN NAKARMI(1RI16IS038)
ICHCHHA PARAJULI(1RI16IS013)
SHIBAM MALLICK(1RI16IS041)

Under the guidance of


Prof. Swetha K B. MTech
Assistant Professor, Dept. of ISE, RRIT

DEPARTMENT OF INFORMATION SCIENCE ENGINEERING


R R INSTITUTE OF TECHNOLOGY
CHIKKABANAVARA, BENGALURU-560090
R R INSTITUTE OF TECHNOLOGY
CHIKKABANAVARA, BENGALURU - 560090

Certificate
DEPARTMENT OF INFORMATION SCIENCE ENGINEERING

This is to certify that the project entitled “ Advanced Scientific


Calculator” is a bonafide work carried out by MO.IRFAN MUSALMAN(1RI16IS021),

MADHAV BAIJU(1RI16IS019),RUBINA SHRESTHA(1RI16IS030),PUJA


TIWARI(1RI16IS026) in partial fulfillment for the award of degree in BACHELOR OF

ENGINEERING IN INFORMATION SCIENCE ENGINEERING from VISVESVARAYA TECHNOLOGICAL


UNIVERSITY, BELAGAVI during the academic year 2018-19. It is certified tha all the
corrections/suggestions indicated for internal Assessment have been incorporated in the report
submitted in the department Library. This Project report has been approved as it satisfies the
academic requirements in respect of python application programming (15ISL664) prescribed
for award of said degree.

………………………….. ………………….. ………………………


Signature of Internal Guide Signature of HOD Signature of Principal
[Prof. Swetha K B] [Prof. Emmanuel R] [Dr. Manjunatha M B]
Assistant Professor Professor & HOD Principal
Dept. of ISE, RRIT Dept. of ISE, RRIT RRIT, Bangalore

Name of the Examiners Signature with date

1……………………………… ……………………….
DECLARATION
ASHISH ACHARYA,SHAILESH MAN NAKARMI,ICHCHHA
PARAJULI,SHIBAM MALLICK student of 6th Semester B.E in the
Department Of Information Science and Engineering, RRIT, Bangalore -
560090, hereby declare that the Project entitled “ Advanced Scientific Calculator”
has been carried out under the supervision of Prof. Swetha K B,, Asst.
Professor, Dept. of ISE, RRIT, and submitted in partial fulfilment of the source
requirements for the award of degree in Bachelor of Information Science and
Engineering of VISVESVARAYA TECHNOLOGICAL UNIVERSITY,
BELAGAVI during an academic year 2018-2019.

PLACE: BENGALURU ASHISH ACHARYA

DATE: SHAILESH MAN NAKARMI

ICHCHHA PARAJULI
SHIBAM MALLICK
ACKNOWLEDGEMENT

We consider it a privilege to whole-heartedly express our gratitude and


respect to each and every one who guided and helped us in the successful
completion of these projects.

We are grateful to Principal, Dr. Manjunatha M B, RRIT, Bangalore


and all staff members of Information Science and Engineering Department for
their kind co-operation.
We are extremely thankful to Prof. Emmanuel R R, Professor and HOD,
Department of Information Science and Engineering, for his co-operation and
encouragement. we thank him for providing me an opportunity to carry out the
project at college.
We express our deepest gratitude and sincere thanks to Prof. Swetha K B,
Assistant professor, Department of Information Science and Engineering for
his valuable guidance during the course of this Project and continuous suggestions
to make our Project successful.

Finally, it is a pleasure and happiness to the friendly cooperation showed


by all the staff members of Information science engineering department.
ABSTRACT

it is a scientifc calculator application. It is used to calculate the math fucntions easily.


In this application two types of calculator are there
1.standard calculator
2.scientific calculator
first one is very simple to solve arithmetic operations. And also convert the result into either
integer or float pointing number.

And then second one is scientific notation type math functions are there like sin.cos,tan,log
etc.
it is very useful to solve the odd math calculations in less time and in simple manner and also
easily to use.

Especially I used menu bar with two items one is standard and second one is scientific
after clicking the standard item it will shows the standard calculator
after clicking the scientific item it will shows the scientific calculator with standard also.

By using Tkinter in python I developed this application it is also converted into .exe file by using
pyinstaller then it is now a desktop application.
Lastly it shows desktop icon in out system if u install it otherwise not show in your desktop.
SOURCE CODE

from Tkinter import *


from math import *
import tkinter.messagebox

root = Tk()
root.title("Calculator")
root.resizable(0, 0)
root.geometry("466x568+0+0")
root.configure(background="powder blue")

calc=Frame(root,bg="powder blue")
calc.grid()

Label1 = Label(calc, text = "Scientific Calculator",fg="green",font=('arial',20,'bold','italic'))


Label1.grid(row=0, columnspan=4,column=4)
equa = ""
equation = StringVar()
calculation = Entry(calc, textvariable = equation,fg="red",font=('arial',15,'bold'),bg="powder
blue",bd=30,width=28,justify=RIGHT)
calculation.grid(row=0, columnspan=4,column=0,pady=1)
def btnPress(num):
global equa
equa = equa + str(num)
equation.set(equa)
def EqualPress():
global equa
x=calculation.get()
if(equa==""):
equa=equa+x
try:
total = str(eval(equa))
equation.set(total)
if(float(total)==0):
equa=""
else:
equa=total
except:
equation.set("ERROR")
equa=""
pass
def ClearPress():
global equa
equa = ""
equation.set("")
Button0 = Button(calc, text="0", command = lambda:btnPress(0),
borderwidth=1,bd=4,width=6,height=1,bg="powder blue",relief=SOLID,font=('arial',15,'bold'))
Button0.grid(row = 7, column = 2, padx=10, pady=10)

Button1 = Button(calc, text="1", command = lambda:btnPress(1),


borderwidth=1,bd=4,width=6,height=1,bg="powder blue",relief=SOLID,font=('arial',15,'bold'))
Button1.grid(row = 3, column = 0, padx=10, pady=10)

Button14 = Button(calc, text="(", command = lambda:btnPress("("),


borderwidth=1,bd=4,width=6,height=1,bg="powder blue",relief=SOLID,font=('arial',15,'bold'))
Button14.grid(row = 6, column = 0, padx=10, pady=10)

Button2 = Button(calc, text="2", command = lambda:btnPress(2),


borderwidth=1,bd=4,width=6,height=1,bg="powder blue",relief=SOLID,font=('arial',15,'bold'))
Button2.grid(row = 3, column = 1, padx=10, pady=10)

Button3 = Button(calc, text="3", command = lambda:btnPress(3),


borderwidth=1,bd=4,width=6,height=1,bg="powder blue",relief=SOLID,font=('arial',15,'bold'))
Button3.grid(row = 3, column = 2, padx=10, pady=10)

Button13 = Button(calc, text="sqrt", command = lambda:btnPress("sqrt("),


borderwidth=1,bd=4,width=6,height=1,bg="powder blue", relief=SOLID,font=('arial',15,'bold'))
Button13.grid(row = 5, column = 7, padx=10, pady=10)

Button21 = Button(calc, text="pow", command = lambda:btnPress("pow("),


borderwidth=1,bd=4,width=6,height=1,bg="powder blue",relief=SOLID,font=('arial',15,'bold'))
Button21.grid(row = 5, column = 5, padx=10, pady=10)

Button4 = Button(calc, text="4", command = lambda:btnPress(4),


borderwidth=1,bd=4,width=6,height=1,bg="powder blue",relief=SOLID,font=('arial',15,'bold'))
Button4.grid(row = 4, column = 0, padx=10, pady=10)

Button15 = Button(calc, text=")", command = lambda:btnPress(")"),


borderwidth=1,bd=4,width=6,height=1,bg="powder blue", relief=SOLID,font=('arial',15,'bold'))
Button15.grid(row = 6, column = 1, padx=10, pady=10)
Button5 = Button(calc, text="5", command = lambda:btnPress(5),
borderwidth=1,bd=4,width=6,height=1,bg="powder blue", relief=SOLID,font=('arial',15,'bold'))
Button5.grid(row = 4, column = 1, padx=10, pady=10)
Button6 = Button(calc, text="6", command = lambda:btnPress(6),
borderwidth=1,bd=4,width=6,height=1,bg="powder blue", relief=SOLID,font=('arial',15,'bold'))
Button6.grid(row = 4, column = 2, padx=10, pady=10)
Button7 = Button(calc, text="7", command = lambda:btnPress(7),
borderwidth=1,bd=4,width=6,height=1,bg="powder blue", relief=SOLID,font=('arial',15,'bold'))
Button7.grid(row = 5, column = 0, padx=10, pady=10)
Button16 = Button(calc, text=".", command = lambda:btnPress("."),
borderwidth=1,bd=4,width=6,height=1,bg="powder blue", relief=SOLID,font=('arial',15,'bold'))
Button16.grid(row = 6, column = 2, padx=10, pady=10)
Button8 = Button(calc, text="8", command = lambda:btnPress(8),
borderwidth=1,bd=4,width=6,height=1,bg="powder blue", relief=SOLID,font=('arial',15,'bold'))
Button8.grid(row = 5, column = 1, padx=10, pady=10)
Button9 = Button(calc, text="9", command = lambda:btnPress(9),
borderwidth=1,bd=4,width=6,height=1,bg="powder blue", relief=SOLID,font=('arial',15,'bold'))
Button9.grid(row = 5, column = 2, padx=10, pady=10)
Plus = Button(calc, text="+", command = lambda:btnPress("+"),
borderwidth=1,bd=4,width=6,height=1,bg="powder blue", relief=SOLID,font=('arial',15,'bold'))
Plus.grid(row = 3, column = 3, padx=10, pady=10)
Minus = Button(calc, text="-", command = lambda:btnPress("-"),
borderwidth=1,bd=4,width=6,height=1,bg="powder blue", relief=SOLID,font=('arial',15,'bold'))
Minus.grid(row = 4, column = 3, padx=10, pady=10)
Button18 = Button(calc, text="sin", command = lambda:btnPress("sin("),
borderwidth=1,bd=4,width=6,height=1,bg="powder blue", relief=SOLID,font=('arial',15,'bold'))
Button18.grid(row = 4, column = 4, padx=10, pady=10)

Button22 = Button(calc, text="log", command = lambda:btnPress("log("),


borderwidth=1,bd=4,width=6,height=1,bg="powder blue", relief=SOLID,font=('arial',15,'bold'))
Button22.grid(row = 3, column = 4, padx=10, pady=10)

Multiply = Button(calc, text="*", command = lambda:btnPress("*"),


borderwidth=1,bd=4,width=6,height=1,bg="powder blue", relief=SOLID,font=('arial',15,'bold'))
Multiply.grid(row = 5, column = 3, padx=10, pady=10)

Button19 = Button(calc, text="cos", command = lambda:btnPress("cos("),


borderwidth=1,bd=4,width=6,height=1,bg="powder blue", relief=SOLID,font=('arial',15,'bold'))
Button19.grid(row = 5, column = 4, padx=10, pady=10)

Button23 = Button(calc, text="pi", command = lambda:btnPress("pi"),


borderwidth=1,bd=4,width=6,height=1,bg="powder blue", relief=SOLID,font=('arial',15,'bold'))
Button23.grid(row = 5, column = 6, padx=10, pady=10)

Divide = Button(calc, text="/", command = lambda:btnPress("/"),


borderwidth=1,bd=4,width=6,height=1,bg="powder blue", relief=SOLID,font=('arial',15,'bold'))
Divide.grid(row = 7, column = 3, padx=10, pady=10)

Button20 = Button(calc, text="factorial", command = lambda:btnPress("factorial("),


borderwidth=1,bd=4,width=6,height=1,bg="powder blue", relief=SOLID,font=('arial',15,'bold'))
Button20.grid(row = 6, column = 4, padx=10, pady=10)

Button24 = Button(calc, text=",", command = lambda:btnPress(","),


borderwidth=1,bd=4,width=6,height=1,bg="powder blue", relief=SOLID,font=('arial',15,'bold'))
Button24.grid(row = 6, column = 6, padx=10, pady=10)

Equal = Button(calc, text="=", command = EqualPress,


borderwidth=1,bd=4,width=6,height=1,bg="powder blue", relief=SOLID,font=('arial',15,'bold'))
Equal.grid(row=7, column=1, padx=10, pady=10)

Clear = Button(calc, text="CLEAR", command = ClearPress,


borderwidth=1,bd=4,width=6,height=1,bg="powder blue", relief=SOLID,font=('arial',15,'bold'))
Clear.grid(row = 7, column = 0, padx=10, pady=10)

Button17 = Button(calc, text="%", command = lambda:btnPress("%"),


borderwidth=1,bd=4,width=6,height=1,bg="powder blue", relief=SOLID,font=('arial',15,'bold'))
Button17.grid(row = 6, column = 3, padx=10, pady=10)

Button25 = Button(calc, text="degrees", command = lambda:btnPress("degrees("),


borderwidth=1,bd=4,width=6,height=1,bg="powder blue", relief=SOLID,font=('arial',15,'bold'))
Button25.grid(row = 3, column = 5, padx=10, pady=10)

Button26 = Button(calc, text="log10", command = lambda:btnPress("log10("),


borderwidth=1,bd=4,width=6,height=1,bg="powder blue", relief=SOLID,font=('arial',15,'bold'))
Button26.grid(row = 3, column = 6, padx=10, pady=10)

Button27 = Button(calc, text="log1p", command = lambda:btnPress("log1p("),


borderwidth=1,bd=4,width=6,height=1,bg="powder blue", relief=SOLID,font=('arial',15,'bold'))
Button27.grid(row = 3, column = 7, padx=10, pady=10)

Button28 = Button(calc, text="radians", command = lambda:btnPress("radians("),


borderwidth=1,bd=4,width=6,height=1,bg="powder blue", relief=SOLID,font=('arial',15,'bold'))
Button28.grid(row = 4, column = 5, padx=10, pady=10)

Button29 = Button(calc, text="sinh", command = lambda:btnPress("sinh("),


borderwidth=1,bd=4,width=6,height=1,bg="powder blue", relief=SOLID,font=('arial',15,'bold'))
Button29.grid(row = 4, column = 6, padx=10, pady=10)

Button30 = Button(calc, text="cosh", command = lambda:btnPress("cosh("),


borderwidth=1,bd=4,width=6,height=1,bg="powder blue", relief=SOLID,font=('arial',15,'bold'))
Button30.grid(row = 4, column = 7, padx=10, pady=10)

Button31 = Button(calc, text="tan", command = lambda:btnPress("tan("),


borderwidth=1,bd=4,width=6,height=1,bg="powder blue", relief=SOLID,font=('arial',15,'bold'))
Button31.grid(row = 6, column = 6, padx=10, pady=10)

Button32 = Button(calc, text="tanh", command = lambda:btnPress("tanh("),


borderwidth=1,bd=4,width=6,height=1,bg="powder blue", relief=SOLID,font=('arial',15,'bold'))
Button32.grid(row = 6, column = 7, padx=10, pady=10)
Button33 = Button(calc, text="E", command = lambda:btnPress("e"),
borderwidth=1,bd=4,width=6,height=1,bg="powder blue", relief=SOLID,font=('arial',15,'bold'))
Button33.grid(row = 7, column = 4, padx=10, pady=10)

Button34 = Button(calc, text="atan", command = lambda:btnPress("atan("),


borderwidth=1,bd=4,width=6,height=1,bg="powder blue", relief=SOLID,font=('arial',15,'bold'))
Button34.grid(row = 7, column = 6, padx=10, pady=10)

Button35 = Button(calc, text="gcd", command = lambda:btnPress("gcd("),


borderwidth=1,bd=4,width=6,height=1,bg="powder blue", relief=SOLID,font=('arial',15,'bold'))
Button35.grid(row = 6, column = 5, padx=10, pady=10)

Button36 = Button(calc, text="exp", command = lambda:btnPress("exp("),


borderwidth=1,bd=4,width=6,height=1,bg="powder blue", relief=SOLID,font=('arial',15,'bold'))
Button36.grid(row = 7, column = 5, padx=10, pady=10)

Button37 = Button(calc, text="lgamma", command = lambda:btnPress("lgamma("),


borderwidth=1,bd=4,width=6,height=1,bg="powder blue", relief=SOLID,font=('arial',15,'bold'))
Button37.grid(row = 7, column = 7, padx=10, pady=10)

Button38 = Button(calc, text="asin", command = lambda:btnPress("asin("),


borderwidth=1,bd=4,width=6,height=1,bg="powder blue", relief=SOLID,font=('arial',15,'bold'))
Button38.grid(row = 8, column = 4, padx=10, pady=10)

Button39 = Button(calc, text="acos", command = lambda:btnPress("acos("),


borderwidth=1,bd=4,width=6,height=1,bg="powder blue", relief=SOLID,font=('arial',15,'bold'))
Button39.grid(row = 8, column = 5, padx=10, pady=10)

Button40 = Button(calc, text="atan2", command = lambda:btnPress("atan2("),


borderwidth=1,bd=4,width=6,height=1,bg="powder blue", relief=SOLID,font=('arial',15,'bold'))
Button40.grid(row = 8, column = 6, padx=10, pady=10)

Button41 = Button(calc, text="hypot", command = lambda:btnPress("hypot("),


borderwidth=1,bd=4,width=6,height=1,bg="powder blue", relief=SOLID,font=('arial',15,'bold'))
Button41.grid(row = 8, column = 7, padx=10, pady=10)

Button42 = Button(calc, text="acosh", command = lambda:btnPress("acosh("),


borderwidth=1,bd=4,width=6,height=1,bg="powder blue", relief=SOLID,font=('arial',15,'bold'))
Button42.grid(row = 9, column = 4, padx=10, pady=10)

Button43 = Button(calc, text="asinh", command = lambda:btnPress("asinh("),


borderwidth=1,bd=4,width=6,height=1,bg="powder blue", relief=SOLID,font=('arial',15,'bold'))
Button43.grid(row = 9, column = 5, padx=10, pady=10)
Button44 = Button(calc, text="atanh", command = lambda:btnPress("atanh("),
borderwidth=1,bd=4,width=6,height=1,bg="powder blue", relief=SOLID,font=('arial',15,'bold'))
Button44.grid(row = 9, column = 6, padx=10, pady=10)

Button45 = Button(calc, text="gamma", command = lambda:btnPress("gamma("),


borderwidth=1,bd=4,width=6,height=1,bg="powder blue", relief=SOLID,font=('arial',15,'bold'))
Button45.grid(row = 9, column = 7, padx=10, pady=10)

Button46 = Button(calc, text="ceil", command = lambda:btnPress("ceil("),


borderwidth=1,bd=4,width=6,height=1,bg="powder blue", relief=SOLID,font=('arial',15,'bold'))
Button46.grid(row = 10, column = 4, padx=10, pady=10)

Button47 = Button(calc, text="floor", command = lambda:btnPress("floor("),


borderwidth=1,bd=4,width=6,height=1,bg="powder blue", relief=SOLID,font=('arial',15,'bold'))
Button47.grid(row = 10, column = 5, padx=10, pady=10)

Button48 = Button(calc, text="expm1", command = lambda:btnPress("expm1("),


borderwidth=1,bd=4,width=6,height=1,bg="powder blue", relief=SOLID,font=('arial',15,'bold'))
Button48.grid(row = 10, column = 6, padx=10, pady=10)

Button49 = Button(calc, text="abs", command = lambda:btnPress("abs("),


borderwidth=1,bd=4,width=6,height=1,bg="powder blue", relief=SOLID,font=('arial',15,'bold'))
Button49.grid(row = 10, column = 7, padx=10, pady=10)

Button50 = Button(calc, text="int", command = lambda:btnPress("int("),


borderwidth=1,bd=4,width=6,height=1,bg="powder blue", relief=SOLID,font=('arial',15,'bold'))
Button50.grid(row = 8, column = 1, padx=10, pady=10)

Button51 = Button(calc, text="float", command = lambda:btnPress("float("),


borderwidth=1,bd=4,width=6,height=1,bg="powder blue", relief=SOLID,font=('arial',15,'bold'))
Button51.grid(row = 8, column = 2, padx=10, pady=10)

def exit():
exit=tkinter.messagebox.askyesno('scientific calculator',"confirm if you want to exit")
if exit>0:
root.destroy()
return
def scientific():
root.resizable(width=False,height=False)
root.geometry("940x568+0+0")
def standard():
root.resizable(width=False,height=False)
root.geometry("466x568+0+0")

menubar=Menu(calc)

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=exit)

root.config(menu=menubar)
root.mainloop()

Potrebbero piacerti anche