Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 19

SCIENTIFIC

CALCULATOR
WITH
PYTHON
SUGUNA PIP SCHOOL, COIMBATORE

CERTIFICATE
ComPUTER SCIENCEPROJECT

This is to certify that the Computer Science project report titled


…………………………………………………………………………
Which has been submitted to SUGUNA PIP School , meeting the
requirements of the CBSE Board practical examination for the
academic year 2021 – 2022, is a bonafide work done by
………………………………………………………………

Signature of Principal Teacher Incharge

Signature of Internal Examiner Signature of External Examiner


DECLARATION

I, ______________________________, of class XII, hereby declare that the Project entitled

“_________________________________________________________________________”

submitted to SUGUNA PIP SCHOOL: (Affiliation number – 1930213), Nehru Nagar, Kalapatty

Road, Coimbatore, Tamil Nadu – 641014. Regard to the class XII Senior Secondary Examination

for the

CBSE Board, is accord of original project work done by me under the guidance and supervision of

ALLPIOUS R, Faculty in Information technology department, Suguna PIP School, further certify
that

I. The work contained in the report is original and is done under the general supervision of

my Faculty.

II. The work has not been submitted to any other Institution/Board for class XII Senior

Secondary Examination, CBSE Board.

Name: ________________

Roll No.: _______________


Index

acknowledgement………………………………….5 project
abstract…………………………………..6 system
requirement……………………………….7 python and its
feature………………………….8 source
code………………………………………………9 sample
output………………………………………….11
conclusion…………………………………………………12
bibliography…………………………………………….13
ACKNOWLEDGEMENT

I thank my family for supporting me to complete my project

successfully. I would like to express my deep sense of gratitude

to my teacher, ALLPIOUS R, Faculty in Information technology

department, Suguna PIP School, Coimbatore, for her invaluable

support and advice which helped me to complete this project. I

am honoured to be doing this under her supervision.

I extend my gratitude to MR. POOVANNAN, Principal and

all the staff members for the support. Finally, I heartfully thank

all my dear friends and family members, who have extended their

support and kindness intimately.


PROJECT ABSTRACT

A scientific calculator is a calculator designed to help


you calculate science, engineering, and mathematics
problems. It has way more buttons than your standard
calculator that just lets you do your four basic arithmetic
operations of addition, subtraction, multiplication, and
division.

They are widely used in both education and professional


settings. hey are very often required for math classes from
the junior high school level through college, and are
generally either permitted or required on
many standardized tests covering math and science
subjects; as a result, many are sold into educational
markets to cover this demand

SYSTEM REQUIREMENTS
Recommended System Requirements

Processors: Intel® Core™ I3 proCessor 4300M at 2.60 GHz.

Disk space: 2 to 4 GB.

Operating systems: Windows® 10, MACOS, and UBUNTU.


Python Versions: 3.X.X or Higher.
Python and its features

Easy to Learn and Use


Python is easy to learn as compared to other programming languages. Its
syntax is straightforward and much the same as the English language.
There is no use of the semicolon or curly bracket, the indentation defines
the code block. It is the recommended programming language for
beginners.

Cross-platform Language
Python can run equally on different platforms such as Windows, Linux,
UNIX, and Macintosh, etc. So, we can say that Python is a portable
language. It enables programmers to develop the software for several
competing platforms by writing a program only once.

Free and Open Source


Python is freely available for everyone. It is freely available on its
official website www.python.org. It has a large community across the
world that is dedicatedly working towards make new python modules
and functions. Anyone can contribute to the Python community. The
open-source means, "Anyone can download its source code without
paying any penny."
SOURCE CODE
import math

class calci(object):

def add(self,num1,num2):

answer = num1 + num2

print('Sum = ',answer)

def sub(self,num1,num2):

answer = num1 - num2

print('Difference = ',answer)

def mul(self,num1,num2):

answer = num1 * num2

print('Product = ',answer)

def div(self,num1,num2):

answer = num1 / num2

print('Quotient = ',answer)

def sinrad(self,num):

answer = math.sin(num)

print("Sine (%f) = %f" %(num,answer))

def cosrad(self,num):

answer = math.cos(num)

print("Cosine(%f) = %f" %(num,answer))

def tanrad(self,num):

answer = math.tan(num)

print("Tan(%f) = %f" %(num,answer))

def cosecrad(self,num):

answer = 1/(math.sin(num))
print("Sine(%f = %f" %(num,answer))

def secrad(self,num):

answer = 1/(math.cos(num))

print("Sec(%f) = %f" %(num,answer))

def cotrad(self,num):

answer = 1/(math.tan(num))

print("Cot(%f) = %f" %(num,answer))

def sindeg(self,num):

answer = math.sin(math.radians(num))

print("Sin(%f) in degrees = %f" %(num,answer))

def cosdeg(self,num):

answer = math.cos(math.radians(num))

print("Cos(%f) in degrees = %f" %(num,answer))

def tandeg(self,num):

answer = math.tan(math.radians(num))

print("Tan(%f) in degrees = %f" %(num,answer))

def cosecdeg(self,num):

answer = 1/(math.sin(math.radians(num)))

print("Cosec(%f) in degrees = %f" %(num,answer))

def secdeg(self,num):

answer = 1/(math.cos(math.radians(num)))

print("Sec(%f) in degrees = %f" %(num,answer))

def cotdeg(self,num):

answer = 1/(math.tan(math.radians(num)))

print("Cot(%f) in degrees = %f" %(num,answer))

def ln(self,num):

answer = math.log(num)
print("ln(%f) = %f" %(num,answer))

def logten(self,num):

answer = math.log10(num)

print("log10(%f) = %f" %(num,answer))

def logbasex(self,num,x):

answer = math.log(num,x)

print("log base(%f)(%f) = %f" %(x,num,answer))

def squareroot(self,num):

answer = math.sqrt(num)

print("Square Root(%f) = %f " %(num,answer))

def pie(self):

print( 'pi = ',math.pi)

def powerof(self,num,raiseby):

answer = math.pow(num,raiseby)

print("%f ^ (%f) = %f" %(num,raiseby,answer) )

calc = calci()

print('welcome to casio')

print("Here's a list of choices")

print('*'*60)

print("1 : Addition \t\t 12 : Sine in degrees")

print("2 : Subtraction \t 13 : Cosine in degrees")

print("3 : Multiplication\t 14 : Tan in degrees")

print("4 : Division \t\t 15 : Cosecant in degrees")

print("5 : Sine in radians\t 16 : Secant in degrees")

print("6 : Coisne in radians\t 17 : Cot in degrees")

print("7 : Tan in radians\t 18 : Natural log")

print("8 : Cosecant in radians 19 : Base 10 log")


print("9 : Secant in radians\t 20 : Log base 'x'")

print("10 : Cot in radians\t 21 : Square root")

print("11 : pi \t\t 22 : Power of")

print('*'*60)

choice = ""

while True:

try:

choice = int(input('enter a number of your choice from the above list : '))

except:

print("Enter a valid number")

if choice == 1:

n1 = int(input('enter the first number to add : '))

n2 = int(input('enter the second number to add : '))

n1 = float(input('enter the first number to add : '))

n2 = float(input('enter the second number to add : '))

calc.add(n1,n2)

elif choice == 2:

n1 = int(input('enter the first number to subtract : '))

n2 = int(input('enter the second number to subtract : '))

n1 = float(input('enter the first number to subtract : '))

n2 = float(input('enter the second number to subtract : '))

calc.sub(n1,n2)

elif choice == 3:

n1 = int(input('enter the first number to multiply : '))

n2 = int(input('enter the second number to multiply : '))

n1 = float(input('enter the first number to multiply : '))

n2 = float(input('enter the second number to multiply : '))


calc.mul(n1,n2)

elif choice == 4:

n1 = float(input('enter the first number to divide : '))

n2 = float(input('enter the second number to divide : '))

calc.div(n1,n2)

elif choice == 5:

n = float(input('enter a number to find its sine in rad: '))

calc.sinrad(n)

elif choice == 6:

n = float(input('enter a number to find its cos in rad: '))

calc.cosrad(n)

elif choice == 7:

n = float(input('enter a number to find its tan in rad : '))

calc.tanrad(n)

elif choice == 8:

n = float(input('enter a number to find its cosec in rad : '))

calc.cosecrad(n)

elif choice == 9:

n = float(input('enter a number to find its sec in rad : '))

calc.secrad(n)

elif choice == 10:

n = float(input('enter a number to find its cot in rad : '))

calc.cotrad(n)

elif choice == 11:

calc.pie()

elif choice == 12:

n = float(input('enter a number to find its sine in deg : '))


calc.sindeg(n)

elif choice == 13:

n =float(input('enter a number to find its cos in deg : '))

calc.cosdeg(n)

elif choice == 14:

n = float(input('enter a number to find its tan in deg : '))

calc.tandeg(n)

elif choice == 15:

n =float(input('enter a number to find its cosec in deg : '))

calc.cosecdeg(n)

elif choice == 16:

n = float(input('enter a number to find its sec in deg : '))

calc.secdeg(n)

elif choice == 17:

n = float(input('enter a number to find its cot in deg : '))

calc.cotdeg(n)

elif choice == 18:

n =float(input('enter a number to find its natural deg : '))

calc.ln(n)

elif choice == 19:

n = float(input('enter a number to find its log to base 10 : '))

calc.logten(n)

elif choice == 22:

n = float(input('enter a number : '))

po = float(input('enter its power : '))

calc.powerof(n,po)

elif choice == 21:


n = float(input('enter a number to find its square root : '))

calc.squareroot(n)

elif choice == 20:

base = float(input('enter base value : '))

n = float(input('enter a number to find its log to the given base value: '))

calc.logbasex(n,base)

else:

print("WARNING : Enter a valid input from the list above")


SAMPLE CODE
welcome to casio

Here's a list of choices

************************************************************

1 : Addition 12 : Sine in degrees

2 : Subtraction 13 : Cosine in degrees

3 : Multiplication 14 : Tan in degrees

4 : Division 15 : Cosecant in degrees

5 : Sine in radians 16 : Secant in degrees

6 : Coisne in radians 17 : Cot in degrees

7 : Tan in radians 18 : Natural log

8 : Cosecant in radians 19 : Base 10 log

9 : Secant in radians 20 : Log base 'x'

10 : Cot in radians 21 : Square root

11 : pi 22 : Power of

************************************************************

enter a number of your choice from the above list : 22

enter a number : 8

enter its power : 7

8.000000 ^ (7.000000) = 2097152.000000

enter a number of your choice from the above list : 12

enter a number to find its sine in deg : 30

Sin(30.000000) in degrees = 0.500000


CONCLUSION

1.allows students solve complicated problems quickly and in an


efficient manner. Additionally, it can reduce the problem to simpler
tasks and allows the student to devote more time in understanding
the problem.

2.IT PROMOTES ACCURACY IN PROBLEMS WHICH


HELPS IN FURTHER UNDERSTANDING OF A TOPIC
DEEPLY

3. Calculators allow students to work more quickly, which


means they can solve more problems in a given time. So you can
increase the number and complexity of the problems you
introduce in each lesson without increasing the time devoted to
problem solving lessons.

BIBLIOGRAPHY
1.GEEKS FOR GEEKS WEBSITE

2.github.com

3.w3schools.com

You might also like