Professional Documents
Culture Documents
SIMPLE CALCULATOR
Submitted by
Guruh Karthic G
Roll.No : 11B04
Certificate
This is to certify that Guruh Karthic G of class XI-B of Sakthi
Vinayakar Hindu Vidyalaya CBSE Senior Secondary School
Thoothukudi, has successfully completed his project titled Simple
calculator in the subject Computer Science (083) for Session-Ending-
Examination as prescribed by CBSE for the academic year 2021 - 2022.
Date:
Roll No:
Signature of Internal Signature of External Signature of Principal
Examiner Examiner
01 ACKNOWLEDGEMENT 01
02 INTRODUCTION 02
04 PROPOSED SYSTEM 03
06 FLOW CHART 05
07 SOURCE CODE 06
08 OUTPUT SCREEN 09
09 FUTURE ENHANCEMENT 10
10 BIBILIOGRAPHY 10
Acknowledgement
Apart from the efforts of me, the success of any project depends largely on the
encouragement and guidelines of many others. I take this opportunity to express my
gratitude to the people who have been instrumental in the successful completion of
this project.I express deep sense of gratitude to almighty God for giving me strength
for the successful completion of the project.
all the above a friend, who critically reviewed my project and helped in solving each
and every problem, occurred during implementation of the project.
The guidance and support received from all the members who contributed and
who are contributing to this project, was vital for the success of the project.
1
Introduction
This is a software that can add, subtract, multiply or divide two or more
numbers. This project uses Python, a programming language supported by most web
browsers.
RAM : 2/4 GB
SPACE REQUIRED : 5 GB
MONITOR : Required
KEYBOARD AND MOUSE : Required
import sys
print("creator Details")
print("Name: Guruh Karthic \
Class: XI B")
print("This calculating program can do two function:\
1)Simple calculator\
2)If you want to perform single function on many number)\
3)If you want to do calculation by yourself")
Function=int(input("Which function you want to do : "))
if function in range(1,4):
print("You choose function",function)
if function == 1:
print("These Are the folowing set of Operations you can use :)")
print("+ for ADDITION, ","- for SUBSTRACTION, "," * for MULTIPLICATION,
","/ for DIVISION, ","**for Power")
print("
")
no=int(input("Enter the number of Inputs with which you want to do the
operation: "))
#max no is 2 and min no is 5
if no==2:
number_1=float(input("Enter The 1st Number:"))
number_2=float(input("Enter The 2nd Number:"))
elif no==3:
number_1=float(input("Enter The 1st Number:"))
number_2=float(input("Enter The 2nd Number:"))
number_3=float(input("Enter The 3rd Number:"))
elif no==4:
number_1=float(input("Enter The 1st Number:"))
number_2=float(input("Enter The 2nd Number:"))
number_3=float(input("Enter The 3rd Number:"))
number_4=float(input("Enter The 4th Number:"))
elif no==5:
number_1=float(input("Enter The 1st Number:"))
number_2=float(input("Enter The 2nd Number:"))
number_3=float(input("Enter The 3rd Number:"))
number_4=float(input("Enter The 4th Number:"))
number_5=float(input("Enter The 5th Number:"))
else:
print("Minimun number with which operation can be done is 2 &
Maximum number with which operation can be done is 5")
quit()
os.execv(clculator.py, sys.argv)
"+ - ADDITION"
"- - SUBSTRACTION"
"* - MULTIPLICATION"
"/ - DIVISION"
"** - power"
user_input = input("Enter the Function to be used:")
if user_input == "+" and no==2:
number_3=0
number_4=0
number_5=0
if user_input == "+" and no==3:
number_4=0
number_5=0
if user_input == "+" and no==4:
number_5=0
if user_input == "-" and no==2:
number_3=0
number_4=0
number_5=0
if user_input == "-" and no==3:
number_4=0
number_5=0
if user_input == "-" and no==4:
number_5=0
if user_input == "*" and no==2:
number_3=1
number_4=1
number_5=1
if user_input == "*" and no==3:
number_4=1
number_5=1
if user_input == "*" and no==4:
number_5=1
if user_input == "/" and no==2:
number_3=1
number_4=1
number_5=1
if user_input == "/" and no==3:
number_4=1
number_5=1
if user_input == "/" and no==4:
number_5=1
if user_input == "+":
output = number_2 + number_1+ number_3+ number_4+ number_5
print(output)
elif user_input == "-":
output = number_2 - number_1-number_3- number_4- number_5
print(output)
elif user_input == "*":
output = number_2 * number_1* number_3* number_4* number_5
print(output)
elif user_input == "/":
output = number_1 / number_2/ number_3/ number_4/ number_5
print(output)
elif user_input == "n":
output = number_2 ** number_1
print(output)
else:
print ("!*!*! Invalid Entry !*!*!")
elif function == 2:
operation = input("Operation you want to perform : ")
if operation == "+":
test_string = input("Numbers:")
res = [int(i) for i in test_string.split() if i.isdigit()]
a=0
for z in res:
a+=z
print(a)
elif operation == "*":
test_string = input("Numbers:")
res = [int(i) for i in test_string.split() if i.isdigit()]
m=1
for z in res:
m*=z
print(m)
elif operation == "**":
p = int(input("Number to whose you want to calculate power : "))
pp = int(input("Which power you wan to calculate : "))
ppp = p**pp
print(ppp)
elif operation == "-":
s = int(input("Number from which you want to subtract : "))
test_string = input("Numbers you want to subtract :")
res = [int(i) for i in test_string.split() if i.isdigit()]
for z in res:
s-=z
print(s)
elif operation == "/":
d = int(input("Number from which you want to divide : "))
test_string = input("Numbers:")
res = [int(i) for i in test_string.split() if i.isdigit()]
for z in res:
d/=z
print(d)
elif operation == "%":
r = int(input("Number which will be divided : "))
rr = int(input("Number which will divide : "))
rrr = r%rr
print("Remainder is", + rrr)
else :
print("Type Correct operator")
else:
print("Currently working on it, will be done soon. If you want to help you
can connect through GSJ@gmail.com")
else:
print("Please Choose Correctly")
Output
Output for the result of a problem using two numbers with different mathematical
functions.
Future Enhancement
In the future, this program can be made compatible to use it for various
kinds of big sized problems like for calculus where multiplication, division
subtraction and addition is needed. Not only for calculus , also it can be used to solve
any difficult problem which may arrive in future.
This program is open source and addition features can be contributed in freakpython
hub.
At : https://freakpython.com/GSM/simple-calculator
Bibliography