SlideShare une entreprise Scribd logo
1  sur  24
Télécharger pour lire hors ligne
CERTIFICATE
This is to certify that HIMANSHU, a student
of class XII-A, roll no has successfully
completed the research on the below
mentioned project under my guidance
during the session 2017-18 in partial
fulfillment of computer science practical
examination conducted by C.B.S.E New
Delhi in Kendriya Vidyalaya A.F.S
ARJANGARH NEW DELHI
STUDENT SUBJECT TEACHER
SIGNATURE SIGNATURE
(MRS. LOVELY SINGH)
(PGT-COMPUTER SCIENCE)
ACKNOWLEDGEMENT
In the accomplishment of this project successfully,
many people have best owned upon me their blessings
and the heart pledged support, this time I am utilizing
to thank all the people who have been concerned with
project.
Primarily I would thank god for being able to complete
this project with success. Then I would like to thank
my computer science teacher MRS.LOVELY SINGH,
whose valuable guidance has been the ones that
helped me patch this project and make it full proof
success his suggestions and his instructions has
served as the major contributor towards the
completion of the project.
Then I would like to thank my parents and friends who
have helped me with their valuable suggestions and
guidance has been helpful in various phases of the
completion of the project.
Last but not the least I would like to thank my
classmates who have helped me a lot.
- HIMANSHU
SIGNATURE:-
INTRODUCTION
Accordingly, this project aims to develop source code in the form of a
computer program i.e. c++ that a scientific calculator could use to
compute functions such as square root, the exponential, and sine
functions and etc. The idea of this project that
1. Since all the mathematical function such as sin function, cos
function, logarithm function are define in the library function of
<math.h>, thus we have return the value of the function to call
function.
2. For menu driven program, here we have to use switch-case
statement.
3. In this program ,there are two type of calculator,
A). Standard calculator.
B). Scientific calculator.
4. The standard calculator contain simple function such as addition,
subtraction etc. whereas the scientific calculator contain function
sine, cosine, tangent, exponential function etc.
The code of the calculator application mainly comprise of two classes
standard calculator and scientific calculator. The standard calculator
class helps to perform standard calculation. The scientific calculator
class in the other hand, helps to perform scientific calculations. Both
classes contain static function so as to ensure that these function can
be called in the main function through class name.
LOGIC OF THE PROJECT
CREATING THE STANDARD CALCULATOR:-
The standard class aims at performing specific task related to standard
calculation. These task are:-
1. Adding two number
2. Subtracting the second number from the first number.
3. Multiplying two number
4. Dividing first number from second.
5. Modulus of first number by second number.
To perform the above mentioned task, the standard calculator class
implements the following member function.
FUNCTION DESCRIPTION
Addition Returns the addition of two
input number
Subtraction Returns the subtraction of
two number.
Multiplication Returns the multiplication of
two number.
Division Returns the output obtained
after performing
Operation on the input
number
CREATING SCIENTIFIC CALCULATOR:-
You have to need to create scientific calculator class to perform task related to
scientific calculations. Which include finding square or cube etc.
The scientific calculator perform following task:-
1. Determine the square of the number.
2. Determine the square root of the number
3. Determine the first number power of the second number
4. Determine the factorial of a number
5. Determine the sin, cos and tan value of the number.
6. Determine the logarithm, natural logarithm and exponential of the
number.
To perform the above mentioned task in scientific calculator implements the
following member function
FUNCTION DESCRIPTION
Square Accept a number and returns the square of the
number
Squae root Accept a number and returns the square root
of number
Cube Accept two number and returns the first
power to 2nd num.
Fact Returns a factorial of an input number.
Sin_fun Returns the sin value of an input number.
Cos_fun Return the cos value of an input number.
Tan_fun Return the tan value of an input number
Log_fun Return the log value of an input number
Log10_fun Return the log10 value of an input number.
Exp_fun Return the exp value of an input number.
CONTROL DIAGRAM
This diagram tells the interconnection between various menus
and sub-menus.
This shows the transfer of control between various menus
and sub menus
Front screen Main Menu
Standard calculator
Scientific calculator
SOURCE CODE OF SCIENTIFIC
CALCULATOR IN C++:-
#include<iostream.h>
#include<conio.h>
#include<math.h>
#include<stdlib.h>
#define new_calc 1
#define old_calc 0
class stand_calc
{ public:
static double addition(double,double);
static double substract(double,double);
static double multiplication(double,double);
static double division(double,double *);
static double modulus(double *,double *); };
class scien_calc
{ public:
static double square(double);
static double cube(double);
static double power(double,double);
static double sq_root(double);
static double sin_fun(double);
static double cos_fun(double);
static double tan_fun(double);
static long int fact(double);
static double log_fun(double);
static double log10_fun(double);
static double exp_fun(double);
static double sqrt_fun(double); };
double stand_calc::addition(double a,double b)
{ return(a+b); }
double stand_calc::substract(double a,double b)
{ return(a-b); }
double stand_calc::multiplication(double a,double b)
{ return(a*b); }
double stand_calc::division(double a,double *b)
{ while(*b==0)
{ cout<<"n cannot divide by zero";
cout<<"n enter the second number again ";
cin>>*b; }
return(a/(*b)); }
double stand_calc::modulus(double *a,double *b)
{ while(*b==0)
{ cout<<"ncannot divid by zero.";
cout<<"nenter the second nuber again";
cout<<*b; }
int x=(int)*a;
int y=(int)*b;
if(*a-x>0||*b-y>0)
cout<<"nconverting decimal nuber into an integer to perform modulus";
*a=x;
*b=y;
return(x%y); }
double scien_calc::square(double x)
{ return(pow(x,2)); }
double scien_calc::cube(double x)
{ return(pow(x,3)); }
double scien_calc::power(double x,double y)
{ return(pow(x,y));}
long int scien_calc::fact(double x)
{ int n=(int)x;
long int f=1;
while(n>1)
{ f*=n;
n--; }
return f; }
double scien_calc::sin_fun(double x)
{ return(sin(x)); }
double scien_calc::cos_fun(double x)
{ return(cos(x)); }
double scien_calc::tan_fun(double x)
{ return(tan(x)); }
double scien_calc::log_fun(double x)
{ return(log(x)); }
double scien_calc::log10_fun(double x)
{ return(log10(x)); }
double scien_calc::exp_fun(double x)
{ return(exp(x)); }
double scien_calc::sqrt_fun(double x)
{ return(sqrt(x)); }
void main()
{ double num1,num2,num3,temp;
int choice1=0,choice2,flag;
do
{ clrscr();
cout<<"==================type of calculator======================";
cout<<"n1tStandard calculator n2tScientific calculatorn3tQuit";
cout<<"n choose type of the calculator";
cin>>choice1;
flag=new_calc;
switch(choice1)
{ case 1:
do
{ clrscr();
cout<<"====================standard calculator=====================";
cout<<"n1tadditionn2tsubstractionn3tmultiplicationn4tdivisionn5tmodulusn6
treturn to previous menun7tquit";
if(flag==old_calc)
cout<<"n8tclear memory";
cout<<"nchoose type of the calculation:";
cin>>choice2;
switch(choice2)
{ case 1:
if(flag==new_calc)
{ cout<<"enter the first number:";
cin>>num1; }
else
{ num1=temp;
cout<<"nfirst number is "<<num1<<endl; }
cout<<"enter the second number:";
cin>>num2;
num3=stand_calc::addition(num1,num2);
cout<<"naddition of "<<num1<<"+"<<num2<<"="<<num3;
cout<<"npress any key to continue...................";
getch();
temp=num3;
flag=old_calc;
break;
case 2:
if(flag==new_calc)
{ cout<<"enter the first number";
cin>>num1 ; }
else
{ num1=temp;
cout<<"nfirst number is"<<num1<<endl; }
cout<<"enter second number:";
cin>>num2;
num3=stand_calc::substract(num1,num2);
cout<<"nsubstraction of "<<num2<<"-"<<num1<<"="<<num3;
cout<<"npress any key to continue..................";
getch();
temp=num3;
flag=old_calc;
break;
case 3:
if(flag==new_calc)
{ cout<<"enter first number:";
cin>>num1; }
else
{ num1=temp;
cout<<"nfirst number is"<<num1<<endl; }
cout<<"nenter the second number:";
cin>>num2;
num3=stand_calc::multiplication(num1,num2);
cout<<"nmultiplication"<<num1<<"*"<<num2<<"="<<num3;
cout<<"npress any key to contionue.................";
getch();
temp=num3;
flag=old_calc;
break;
case 4:
if(flag==new_calc)
{ cout<<"enter first number:";
cin>>num1; }
else
{ num1=temp;
cout<<"nfirst nuber is"<<num1<<endl; }
cout<<"enter second number";
cin>>num2;
num3=stand_calc::division(num1,&num2);
cout<<"ndivision of"<<"num1"<<"by"<<num2<<"="<<num3;
cout<<"npress any key to continue..............";
getch();
temp=num3;
flag=old_calc;
break;
case 5:
if(flag==new_calc)
{ cout<<"enter the first number:";
cin>>num1; }
else
{ num1=temp;
cout<<"nfirst number is"<<num1<<endl; }
cout<<"enter the second number:";
cin>>num2;
num3=stand_calc::modulus(&num1,&num2);
cout<<"nmodulus of "<<num1<<"by "<<num2<<"is"<<num3;
cout<<"press any key to continue...............";
getch();
temp=num3;
flag=old_calc;
break;
case 6:
cout<<"nreturning to previous menu";
cout<<"npress any key to continue................";
getch();
break;
case 7:
cout<<"n quitting.................";
cout<<"npress any key to continue...........";
getch();
exit(0);
case 8:
if(flag==new_calc)
{ cout<<"ninvalid choice";
cout<<"npress any key to continue............";
getch(); }
else
{ temp=0;
flag=new_calc; }
break;
default:
cout<<"ninvalid choice";
cout<<"npress any key to continue..............";
getch();
break; } }
while(choice2!=6);
break;
case 2:
do
{ clrscr();
cout<<"=============Scientific calculator===============";
cout<<"n1tsquaren2tsquare
rootn3tcuben4tpowern5tfactorialn6tsinn7tcosn8ttann9tlogrithmn10tnat
ural logrithmn11texponentialn12treturn to previous menun13tquit";
if(flag==old_calc)
cout<<"n14tclear memory";
cout<<"n choose type of the calculation :";
cin>>choice2;
switch(choice2)
{ case 1:
if(flag==new_calc)
{ cout<<"enter number to find square :";
cin>>num1; }
else
{ num1=temp;
cout<<"n number is "<<num1<<endl; }
num3=scien_calc::square(num1);
cout<<"nsquare of "<<num1<<"="<<num3;
cout<<"npress any key to continue.............";
getch();
temp=num3;
flag=old_calc;
break;
case 2:
if(flag==new_calc)
{ cout<<"enter number to find square root :";
cin>>num1; }
else
{ num1=temp;
cout<<"n number ="<<num1<<endl; }
num3=scien_calc::sqrt_fun(num1);
cout<<"nsquare of "<<num1<<"="<<num3;
cout<<"npress any key to continue.............";
getch();
temp=num3;
flag=old_calc;
break;
case 3:
if(flag==new_calc)
{ cout<<"enter to find cube";
cin>>num1; }
else
{ num1=temp;
cout<<"nnumber is "<<num1<<endl; }
num3=scien_calc::cube(num1);
cout<<"ncube of"<<num1<<"="<<num3;
cout<<"npress any key to continue..........";
getch();
temp=num3;
flag=old_calc;
break;
case 4:
if(flag==new_calc)
{ cout<<"enter the first number of base to find power";
cin>>num1; }
else
{ num1=temp;
cout<<"nfirst number is"<<num1<<endl; }
cout<<"enter the second number for for to find power:";
cin>>num2;
num3=scien_calc::power(num1,num2);
cout<<"n"<<num1<<"^"<<num2<<"="<<num3;
cout<<"npress any key to continue............";
getch();
temp=num3;
flag=old_calc;
break;
case 5: if(flag==new_calc)
{ cout<<"enter number to find factorial:";
cin>>num1; }
else
{ num1=temp;
cout<<"n number to find factorial is"<<num1<<endl; }
long int num4=scien_calc::fact(num1);
cout<<"nfactorial of"<<num1<<" = "<<num4;
cout<<"npress any key to continue...............";
getch();
temp=num4;
flag=old_calc;
break;
case 6: if(flag==new_calc)
{ cout<<"enter SIN ";
cin>>num1; }
else
{ num1=temp;
cout<<"nnumber for sin value is"<<num1<<endl; }
num3=scien_calc::sin_fun(num1);
cout<<"nSIN"<<num1<<" = "<<num3;
cout<<"npress any key to continue..............";
getch();
temp=num3;
flag=old_calc;
break;
case 7: if(flag==new_calc)
{ cout<<"nenter COS ";
cin>>num1; }
else
{ num1=temp;
cout<<"nnumber for cos value"<<num1<<endl; }
num3=scien_calc::cos_fun(num1);
cout<<"nCOS "<<num1<<"="<<num3;
cout<<"npress any key to continue................";
getch();
temp=num3;
flag=old_calc;
break;
case 8: if(flag==new_calc)
{ cout<<"enter TAN ";
cin>>num1; }
else
{ num1=temp;
cout<<"nnumber for tan value"<<num1<<endl; }
num3=scien_calc::tan_fun(num1);
cout<<"nTAN "<<num1<<"="<<num3;
cout<<"npress any key to continue..............";
getch();
temp=num3;
flag=old_calc;
break;
case 9: if(flag==new_calc)
{ cout<<"enter LOG :";
cin>>num1; }
else
{ num1=temp;
cout<<"nnumber for log value"<<num1<<endl; }
num3=scien_calc::log_fun(num1);
cout<<"nLOG "<<num1<<"="<<num3;
cout<<"npress any key to continue.................";
getch();
temp=num3;
flag=old_calc;
break;
case 10: if(flag==new_calc)
{ cout<<"enter LOG10 :";
cin>>num1; }
else
{ num1=temp;
cout<<"nnumber for natural log value"<<num1<<endl; }
num3=scien_calc::log10_fun(num1);
cout<<"nLOG10 "<<num1<<"="<<num3;
cout<<"npress any key to continue.................";
getch();
temp=num3;
flag=old_calc;
break;
case 11: if(flag==new_calc)
{ cout<<"enter e^ :";
cin>>num1; }
else
{ num1=temp;
cout<<"nnumber for exponential value"<<num1<<endl; }
num3=scien_calc::exp_fun(num1);
cout<<"ne^"<<num1<<"="<<num3;
cout<<"npress any key to continue.................";
getch();
temp=num3;
flag=old_calc;
break;
case 12: cout<<"nreturning to previous menu";
cout<<"npress any key to continue.............";
getch();
break;
case 13:
cout<<"nQuitting..............";
cout<<"npress any key to continue...............";
getch();
exit(0);
case 14:
if(flag==new_calc)
{ cout<<"ninvalid choice";
cout<<"npress any key to continue.................";
getch(); }
else
{ temp=0;
flag=new_calc; }
break;
default:
cout<<"invalid choice";
cout<<"press any key to continue...............";
getch();
break; } }
while(choice2!=13);
break;
case3: cout<<"nQuitting..............";
cout<<"npress any key to continue.............";
getch();
break;
default:
cout<<"ninvalid choice";
cout<<"n press any key to continue.............";
getch();
break;}
}while(choice1!=3);
OUTPUT SCREEN
MAIN SCREEN:-
CHOOSE THE TYPE OF CALCULATOR
SCIENTIFIC CALCULATOR SCREEN:-
IN SCIENTIFIC CALCULATOR, CHOOSE THE TYPE
OF FUNCTION.
RESULT SCREEN:-
FIND YOUR ANSWER
BIBLOGRAPHY
1 HTTP://WWW.GOOGLE.COM/
2 HTTP://EN.WIKIPEDIA.ORG
3 COMPUTER SCIENCE WITH C++ BY SUMITA
ARORA
4 OBJECT ORIENTED PROGRAMMING BY
ROBERT LAFORE
5 COMPUTER SCIENCE WITH C++ BY PREETI
ARORA AND PINKY GUPTA
6 WWW.BOTSKOOL.COM

Contenu connexe

Tendances

Library Management Python, MySQL
Library Management Python, MySQLLibrary Management Python, MySQL
Library Management Python, MySQLDarshit Vaghasiya
 
Computer science project.pdf
Computer science project.pdfComputer science project.pdf
Computer science project.pdfHarshitSachdeva17
 
Informatics Practices/ Information Practices Project (IP Project Class 12)
Informatics Practices/ Information Practices Project (IP Project Class 12)Informatics Practices/ Information Practices Project (IP Project Class 12)
Informatics Practices/ Information Practices Project (IP Project Class 12)KushShah65
 
BANK MANAGEMENT INVESTIGATORY PROJECT CLASS 12TH
BANK MANAGEMENT INVESTIGATORY PROJECT CLASS 12THBANK MANAGEMENT INVESTIGATORY PROJECT CLASS 12TH
BANK MANAGEMENT INVESTIGATORY PROJECT CLASS 12THSHAJUS5
 
Library Management Project (computer science) class 12
Library Management Project (computer science) class 12Library Management Project (computer science) class 12
Library Management Project (computer science) class 12RithuJ
 
Chemistryprojectoncaseininmik 170207030628
Chemistryprojectoncaseininmik 170207030628Chemistryprojectoncaseininmik 170207030628
Chemistryprojectoncaseininmik 170207030628AnuragSharma530
 
Computer Science Investigatory Project Class XII CBSE(Latest Syllabus)(Python...
Computer Science Investigatory Project Class XII CBSE(Latest Syllabus)(Python...Computer Science Investigatory Project Class XII CBSE(Latest Syllabus)(Python...
Computer Science Investigatory Project Class XII CBSE(Latest Syllabus)(Python...ArkaSarkar23
 
CLASS 12 ENGLISH PROJECT ON CHILD LABOUR
CLASS 12 ENGLISH PROJECT ON CHILD LABOURCLASS 12 ENGLISH PROJECT ON CHILD LABOUR
CLASS 12 ENGLISH PROJECT ON CHILD LABOURAryanNaglot
 
IP Project for Class 12th CBSE
IP Project for Class 12th CBSEIP Project for Class 12th CBSE
IP Project for Class 12th CBSESylvester Correya
 
Computer Science Practical File class XII
Computer Science Practical File class XIIComputer Science Practical File class XII
Computer Science Practical File class XIIYugenJarwal
 
cbse 12th chemistry investigatory project
cbse 12th chemistry investigatory project cbse 12th chemistry investigatory project
cbse 12th chemistry investigatory project NIKHIL DWIVEDI
 
Physics Investigatory Project
Physics Investigatory  ProjectPhysics Investigatory  Project
Physics Investigatory ProjectDIVYANSHU KUMAR
 
Physics investigatory project for class 12
Physics investigatory project for class 12Physics investigatory project for class 12
Physics investigatory project for class 12Kavita Kulkarni
 
Computer science class 12 project on Super Market Billing
Computer science class 12 project on Super Market BillingComputer science class 12 project on Super Market Billing
Computer science class 12 project on Super Market BillingHarsh Kumar
 
COMPUTER SCIENCE PROJECT OF RAILWAY RESERVATION SYSTEM PYTHON PROGRAMMING.pdf
COMPUTER SCIENCE PROJECT OF RAILWAY RESERVATION SYSTEM PYTHON PROGRAMMING.pdfCOMPUTER SCIENCE PROJECT OF RAILWAY RESERVATION SYSTEM PYTHON PROGRAMMING.pdf
COMPUTER SCIENCE PROJECT OF RAILWAY RESERVATION SYSTEM PYTHON PROGRAMMING.pdfAkshatTiwari530170
 
Computer science project on Online Banking System class 12
Computer science project on Online Banking System class 12Computer science project on Online Banking System class 12
Computer science project on Online Banking System class 12OmRanjan2
 
Study Of oxalte ion in guava fruit at different stages of ripening
Study Of oxalte ion in guava fruit at different stages of ripeningStudy Of oxalte ion in guava fruit at different stages of ripening
Study Of oxalte ion in guava fruit at different stages of ripeningPrince Warade
 

Tendances (20)

Library Management Python, MySQL
Library Management Python, MySQLLibrary Management Python, MySQL
Library Management Python, MySQL
 
Computer science project.pdf
Computer science project.pdfComputer science project.pdf
Computer science project.pdf
 
Informatics Practices/ Information Practices Project (IP Project Class 12)
Informatics Practices/ Information Practices Project (IP Project Class 12)Informatics Practices/ Information Practices Project (IP Project Class 12)
Informatics Practices/ Information Practices Project (IP Project Class 12)
 
BANK MANAGEMENT INVESTIGATORY PROJECT CLASS 12TH
BANK MANAGEMENT INVESTIGATORY PROJECT CLASS 12THBANK MANAGEMENT INVESTIGATORY PROJECT CLASS 12TH
BANK MANAGEMENT INVESTIGATORY PROJECT CLASS 12TH
 
Library Management Project (computer science) class 12
Library Management Project (computer science) class 12Library Management Project (computer science) class 12
Library Management Project (computer science) class 12
 
Chemistryprojectoncaseininmik 170207030628
Chemistryprojectoncaseininmik 170207030628Chemistryprojectoncaseininmik 170207030628
Chemistryprojectoncaseininmik 170207030628
 
Computer Science Investigatory Project Class XII CBSE(Latest Syllabus)(Python...
Computer Science Investigatory Project Class XII CBSE(Latest Syllabus)(Python...Computer Science Investigatory Project Class XII CBSE(Latest Syllabus)(Python...
Computer Science Investigatory Project Class XII CBSE(Latest Syllabus)(Python...
 
CLASS 12 ENGLISH PROJECT ON CHILD LABOUR
CLASS 12 ENGLISH PROJECT ON CHILD LABOURCLASS 12 ENGLISH PROJECT ON CHILD LABOUR
CLASS 12 ENGLISH PROJECT ON CHILD LABOUR
 
IP Project for Class 12th CBSE
IP Project for Class 12th CBSEIP Project for Class 12th CBSE
IP Project for Class 12th CBSE
 
Computer Science Practical File class XII
Computer Science Practical File class XIIComputer Science Practical File class XII
Computer Science Practical File class XII
 
cbse 12th chemistry investigatory project
cbse 12th chemistry investigatory project cbse 12th chemistry investigatory project
cbse 12th chemistry investigatory project
 
Physics Investigatory Project
Physics Investigatory  ProjectPhysics Investigatory  Project
Physics Investigatory Project
 
English Project work.pdf
English Project work.pdfEnglish Project work.pdf
English Project work.pdf
 
Physics investigatory project for class 12
Physics investigatory project for class 12Physics investigatory project for class 12
Physics investigatory project for class 12
 
Computer science class 12 project on Super Market Billing
Computer science class 12 project on Super Market BillingComputer science class 12 project on Super Market Billing
Computer science class 12 project on Super Market Billing
 
Transformer(Class 12 Investigatory Project)
Transformer(Class 12 Investigatory Project)Transformer(Class 12 Investigatory Project)
Transformer(Class 12 Investigatory Project)
 
Computer Investgatort Project (HOTEL MANAGEMENT SYSTEM)
Computer Investgatort Project (HOTEL MANAGEMENT SYSTEM)Computer Investgatort Project (HOTEL MANAGEMENT SYSTEM)
Computer Investgatort Project (HOTEL MANAGEMENT SYSTEM)
 
COMPUTER SCIENCE PROJECT OF RAILWAY RESERVATION SYSTEM PYTHON PROGRAMMING.pdf
COMPUTER SCIENCE PROJECT OF RAILWAY RESERVATION SYSTEM PYTHON PROGRAMMING.pdfCOMPUTER SCIENCE PROJECT OF RAILWAY RESERVATION SYSTEM PYTHON PROGRAMMING.pdf
COMPUTER SCIENCE PROJECT OF RAILWAY RESERVATION SYSTEM PYTHON PROGRAMMING.pdf
 
Computer science project on Online Banking System class 12
Computer science project on Online Banking System class 12Computer science project on Online Banking System class 12
Computer science project on Online Banking System class 12
 
Study Of oxalte ion in guava fruit at different stages of ripening
Study Of oxalte ion in guava fruit at different stages of ripeningStudy Of oxalte ion in guava fruit at different stages of ripening
Study Of oxalte ion in guava fruit at different stages of ripening
 

Similaire à COMPUTER SCIENCE INVESTIGATORY PROJECT 2017-18

Bottom of FormCreate your own FunctionFunctionsFor eac.docx
Bottom of FormCreate your own FunctionFunctionsFor eac.docxBottom of FormCreate your own FunctionFunctionsFor eac.docx
Bottom of FormCreate your own FunctionFunctionsFor eac.docxAASTHA76
 
Mid term sem 2 1415 sol
Mid term sem 2 1415 solMid term sem 2 1415 sol
Mid term sem 2 1415 solIIUM
 
JLK Chapter 5 – Methods and ModularityDRAFT January 2015 Edition.docx
JLK Chapter 5 – Methods and ModularityDRAFT January 2015 Edition.docxJLK Chapter 5 – Methods and ModularityDRAFT January 2015 Edition.docx
JLK Chapter 5 – Methods and ModularityDRAFT January 2015 Edition.docxvrickens
 
Functions Practice Sheet.docx
Functions Practice Sheet.docxFunctions Practice Sheet.docx
Functions Practice Sheet.docxSwatiMishra364461
 
Isc computer project final upload last
Isc computer project final upload lastIsc computer project final upload last
Isc computer project final upload lastArunav Ray
 
APLICACIÓN DE LAS DERIVADAS EN CONTABILIDAD Y AUDITORÍA
APLICACIÓN DE LAS DERIVADAS EN CONTABILIDAD Y AUDITORÍAAPLICACIÓN DE LAS DERIVADAS EN CONTABILIDAD Y AUDITORÍA
APLICACIÓN DE LAS DERIVADAS EN CONTABILIDAD Y AUDITORÍAEDILENEMIROSLAVACAST
 
Computer paper 3 may june 2004 9691 cambridge General Certificate of educatio...
Computer paper 3 may june 2004 9691 cambridge General Certificate of educatio...Computer paper 3 may june 2004 9691 cambridge General Certificate of educatio...
Computer paper 3 may june 2004 9691 cambridge General Certificate of educatio...Alpro
 
Object Oriented Programming Using C++ Practical File
Object Oriented Programming Using C++ Practical FileObject Oriented Programming Using C++ Practical File
Object Oriented Programming Using C++ Practical FileHarjinder Singh
 
function in in thi pdf you will learn what is fu...
function in  in thi pdf you will learn   what                           is fu...function in  in thi pdf you will learn   what                           is fu...
function in in thi pdf you will learn what is fu...kushwahashivam413
 
Monte Carlo Simulation for project estimates v1.0
Monte Carlo Simulation for project estimates v1.0Monte Carlo Simulation for project estimates v1.0
Monte Carlo Simulation for project estimates v1.0PMILebanonChapter
 
Presentation 2 (1).pdf
Presentation 2 (1).pdfPresentation 2 (1).pdf
Presentation 2 (1).pdfziyadaslanbey
 
M166Calculus” ProjectDue Wednesday, December 9, 2015PROJ.docx
M166Calculus” ProjectDue Wednesday, December 9, 2015PROJ.docxM166Calculus” ProjectDue Wednesday, December 9, 2015PROJ.docx
M166Calculus” ProjectDue Wednesday, December 9, 2015PROJ.docxinfantsuk
 

Similaire à COMPUTER SCIENCE INVESTIGATORY PROJECT 2017-18 (20)

Bottom of FormCreate your own FunctionFunctionsFor eac.docx
Bottom of FormCreate your own FunctionFunctionsFor eac.docxBottom of FormCreate your own FunctionFunctionsFor eac.docx
Bottom of FormCreate your own FunctionFunctionsFor eac.docx
 
Mid term sem 2 1415 sol
Mid term sem 2 1415 solMid term sem 2 1415 sol
Mid term sem 2 1415 sol
 
Oop project
Oop projectOop project
Oop project
 
JLK Chapter 5 – Methods and ModularityDRAFT January 2015 Edition.docx
JLK Chapter 5 – Methods and ModularityDRAFT January 2015 Edition.docxJLK Chapter 5 – Methods and ModularityDRAFT January 2015 Edition.docx
JLK Chapter 5 – Methods and ModularityDRAFT January 2015 Edition.docx
 
LMmanual.pdf
LMmanual.pdfLMmanual.pdf
LMmanual.pdf
 
Functions Practice Sheet.docx
Functions Practice Sheet.docxFunctions Practice Sheet.docx
Functions Practice Sheet.docx
 
Isc computer project final upload last
Isc computer project final upload lastIsc computer project final upload last
Isc computer project final upload last
 
APLICACIÓN DE LAS DERIVADAS EN CONTABILIDAD Y AUDITORÍA
APLICACIÓN DE LAS DERIVADAS EN CONTABILIDAD Y AUDITORÍAAPLICACIÓN DE LAS DERIVADAS EN CONTABILIDAD Y AUDITORÍA
APLICACIÓN DE LAS DERIVADAS EN CONTABILIDAD Y AUDITORÍA
 
Computer paper 3 may june 2004 9691 cambridge General Certificate of educatio...
Computer paper 3 may june 2004 9691 cambridge General Certificate of educatio...Computer paper 3 may june 2004 9691 cambridge General Certificate of educatio...
Computer paper 3 may june 2004 9691 cambridge General Certificate of educatio...
 
OOP.pptx
OOP.pptxOOP.pptx
OOP.pptx
 
Object Oriented Programming Using C++ Practical File
Object Oriented Programming Using C++ Practical FileObject Oriented Programming Using C++ Practical File
Object Oriented Programming Using C++ Practical File
 
I PUC CS Lab_programs
I PUC CS Lab_programsI PUC CS Lab_programs
I PUC CS Lab_programs
 
Lecture 7.pptx
Lecture 7.pptxLecture 7.pptx
Lecture 7.pptx
 
GE3171-PROBLEM SOLVING AND PYTHON PROGRAMMING LABORATORY
GE3171-PROBLEM SOLVING AND PYTHON PROGRAMMING LABORATORYGE3171-PROBLEM SOLVING AND PYTHON PROGRAMMING LABORATORY
GE3171-PROBLEM SOLVING AND PYTHON PROGRAMMING LABORATORY
 
function in in thi pdf you will learn what is fu...
function in  in thi pdf you will learn   what                           is fu...function in  in thi pdf you will learn   what                           is fu...
function in in thi pdf you will learn what is fu...
 
Monte Carlo Simulation for project estimates v1.0
Monte Carlo Simulation for project estimates v1.0Monte Carlo Simulation for project estimates v1.0
Monte Carlo Simulation for project estimates v1.0
 
CPP Homework Help
CPP Homework HelpCPP Homework Help
CPP Homework Help
 
Presentation 2 (1).pdf
Presentation 2 (1).pdfPresentation 2 (1).pdf
Presentation 2 (1).pdf
 
M166Calculus” ProjectDue Wednesday, December 9, 2015PROJ.docx
M166Calculus” ProjectDue Wednesday, December 9, 2015PROJ.docxM166Calculus” ProjectDue Wednesday, December 9, 2015PROJ.docx
M166Calculus” ProjectDue Wednesday, December 9, 2015PROJ.docx
 
C++ manual Report Full
C++ manual Report FullC++ manual Report Full
C++ manual Report Full
 

Dernier

Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxVishalSingh1417
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxAmanpreet Kaur
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin ClassesCeline George
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docxPoojaSen20
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...pradhanghanshyam7136
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseAnaAcapella
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docxPoojaSen20
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...ZurliaSoop
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Magic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxMagic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxdhanalakshmis0310
 

Dernier (20)

Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
Magic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxMagic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptx
 

COMPUTER SCIENCE INVESTIGATORY PROJECT 2017-18

  • 1.
  • 2. CERTIFICATE This is to certify that HIMANSHU, a student of class XII-A, roll no has successfully completed the research on the below mentioned project under my guidance during the session 2017-18 in partial fulfillment of computer science practical examination conducted by C.B.S.E New Delhi in Kendriya Vidyalaya A.F.S ARJANGARH NEW DELHI STUDENT SUBJECT TEACHER SIGNATURE SIGNATURE (MRS. LOVELY SINGH) (PGT-COMPUTER SCIENCE)
  • 3. ACKNOWLEDGEMENT In the accomplishment of this project successfully, many people have best owned upon me their blessings and the heart pledged support, this time I am utilizing to thank all the people who have been concerned with project. Primarily I would thank god for being able to complete this project with success. Then I would like to thank my computer science teacher MRS.LOVELY SINGH, whose valuable guidance has been the ones that helped me patch this project and make it full proof success his suggestions and his instructions has served as the major contributor towards the completion of the project. Then I would like to thank my parents and friends who have helped me with their valuable suggestions and guidance has been helpful in various phases of the completion of the project. Last but not the least I would like to thank my classmates who have helped me a lot. - HIMANSHU SIGNATURE:-
  • 4. INTRODUCTION Accordingly, this project aims to develop source code in the form of a computer program i.e. c++ that a scientific calculator could use to compute functions such as square root, the exponential, and sine functions and etc. The idea of this project that 1. Since all the mathematical function such as sin function, cos function, logarithm function are define in the library function of <math.h>, thus we have return the value of the function to call function. 2. For menu driven program, here we have to use switch-case statement. 3. In this program ,there are two type of calculator, A). Standard calculator. B). Scientific calculator. 4. The standard calculator contain simple function such as addition, subtraction etc. whereas the scientific calculator contain function sine, cosine, tangent, exponential function etc. The code of the calculator application mainly comprise of two classes standard calculator and scientific calculator. The standard calculator class helps to perform standard calculation. The scientific calculator class in the other hand, helps to perform scientific calculations. Both classes contain static function so as to ensure that these function can be called in the main function through class name.
  • 5. LOGIC OF THE PROJECT CREATING THE STANDARD CALCULATOR:- The standard class aims at performing specific task related to standard calculation. These task are:- 1. Adding two number 2. Subtracting the second number from the first number. 3. Multiplying two number 4. Dividing first number from second. 5. Modulus of first number by second number. To perform the above mentioned task, the standard calculator class implements the following member function. FUNCTION DESCRIPTION Addition Returns the addition of two input number Subtraction Returns the subtraction of two number. Multiplication Returns the multiplication of two number. Division Returns the output obtained after performing Operation on the input number
  • 6. CREATING SCIENTIFIC CALCULATOR:- You have to need to create scientific calculator class to perform task related to scientific calculations. Which include finding square or cube etc. The scientific calculator perform following task:- 1. Determine the square of the number. 2. Determine the square root of the number 3. Determine the first number power of the second number 4. Determine the factorial of a number 5. Determine the sin, cos and tan value of the number. 6. Determine the logarithm, natural logarithm and exponential of the number. To perform the above mentioned task in scientific calculator implements the following member function FUNCTION DESCRIPTION Square Accept a number and returns the square of the number Squae root Accept a number and returns the square root of number Cube Accept two number and returns the first power to 2nd num. Fact Returns a factorial of an input number. Sin_fun Returns the sin value of an input number. Cos_fun Return the cos value of an input number. Tan_fun Return the tan value of an input number Log_fun Return the log value of an input number Log10_fun Return the log10 value of an input number. Exp_fun Return the exp value of an input number.
  • 7. CONTROL DIAGRAM This diagram tells the interconnection between various menus and sub-menus. This shows the transfer of control between various menus and sub menus Front screen Main Menu Standard calculator Scientific calculator
  • 8. SOURCE CODE OF SCIENTIFIC CALCULATOR IN C++:- #include<iostream.h> #include<conio.h> #include<math.h> #include<stdlib.h> #define new_calc 1 #define old_calc 0 class stand_calc { public: static double addition(double,double); static double substract(double,double); static double multiplication(double,double); static double division(double,double *); static double modulus(double *,double *); }; class scien_calc { public: static double square(double); static double cube(double); static double power(double,double); static double sq_root(double); static double sin_fun(double); static double cos_fun(double); static double tan_fun(double); static long int fact(double); static double log_fun(double); static double log10_fun(double);
  • 9. static double exp_fun(double); static double sqrt_fun(double); }; double stand_calc::addition(double a,double b) { return(a+b); } double stand_calc::substract(double a,double b) { return(a-b); } double stand_calc::multiplication(double a,double b) { return(a*b); } double stand_calc::division(double a,double *b) { while(*b==0) { cout<<"n cannot divide by zero"; cout<<"n enter the second number again "; cin>>*b; } return(a/(*b)); } double stand_calc::modulus(double *a,double *b) { while(*b==0) { cout<<"ncannot divid by zero."; cout<<"nenter the second nuber again"; cout<<*b; } int x=(int)*a; int y=(int)*b; if(*a-x>0||*b-y>0) cout<<"nconverting decimal nuber into an integer to perform modulus"; *a=x; *b=y; return(x%y); } double scien_calc::square(double x) { return(pow(x,2)); } double scien_calc::cube(double x)
  • 10. { return(pow(x,3)); } double scien_calc::power(double x,double y) { return(pow(x,y));} long int scien_calc::fact(double x) { int n=(int)x; long int f=1; while(n>1) { f*=n; n--; } return f; } double scien_calc::sin_fun(double x) { return(sin(x)); } double scien_calc::cos_fun(double x) { return(cos(x)); } double scien_calc::tan_fun(double x) { return(tan(x)); } double scien_calc::log_fun(double x) { return(log(x)); } double scien_calc::log10_fun(double x) { return(log10(x)); } double scien_calc::exp_fun(double x) { return(exp(x)); } double scien_calc::sqrt_fun(double x) { return(sqrt(x)); } void main() { double num1,num2,num3,temp; int choice1=0,choice2,flag; do { clrscr();
  • 11. cout<<"==================type of calculator======================"; cout<<"n1tStandard calculator n2tScientific calculatorn3tQuit"; cout<<"n choose type of the calculator"; cin>>choice1; flag=new_calc; switch(choice1) { case 1: do { clrscr(); cout<<"====================standard calculator====================="; cout<<"n1tadditionn2tsubstractionn3tmultiplicationn4tdivisionn5tmodulusn6 treturn to previous menun7tquit"; if(flag==old_calc) cout<<"n8tclear memory"; cout<<"nchoose type of the calculation:"; cin>>choice2; switch(choice2) { case 1: if(flag==new_calc) { cout<<"enter the first number:"; cin>>num1; } else { num1=temp; cout<<"nfirst number is "<<num1<<endl; } cout<<"enter the second number:"; cin>>num2; num3=stand_calc::addition(num1,num2); cout<<"naddition of "<<num1<<"+"<<num2<<"="<<num3; cout<<"npress any key to continue...................";
  • 12. getch(); temp=num3; flag=old_calc; break; case 2: if(flag==new_calc) { cout<<"enter the first number"; cin>>num1 ; } else { num1=temp; cout<<"nfirst number is"<<num1<<endl; } cout<<"enter second number:"; cin>>num2; num3=stand_calc::substract(num1,num2); cout<<"nsubstraction of "<<num2<<"-"<<num1<<"="<<num3; cout<<"npress any key to continue.................."; getch(); temp=num3; flag=old_calc; break; case 3: if(flag==new_calc) { cout<<"enter first number:"; cin>>num1; } else { num1=temp; cout<<"nfirst number is"<<num1<<endl; } cout<<"nenter the second number:"; cin>>num2;
  • 13. num3=stand_calc::multiplication(num1,num2); cout<<"nmultiplication"<<num1<<"*"<<num2<<"="<<num3; cout<<"npress any key to contionue................."; getch(); temp=num3; flag=old_calc; break; case 4: if(flag==new_calc) { cout<<"enter first number:"; cin>>num1; } else { num1=temp; cout<<"nfirst nuber is"<<num1<<endl; } cout<<"enter second number"; cin>>num2; num3=stand_calc::division(num1,&num2); cout<<"ndivision of"<<"num1"<<"by"<<num2<<"="<<num3; cout<<"npress any key to continue.............."; getch(); temp=num3; flag=old_calc; break; case 5: if(flag==new_calc) { cout<<"enter the first number:"; cin>>num1; } else { num1=temp;
  • 14. cout<<"nfirst number is"<<num1<<endl; } cout<<"enter the second number:"; cin>>num2; num3=stand_calc::modulus(&num1,&num2); cout<<"nmodulus of "<<num1<<"by "<<num2<<"is"<<num3; cout<<"press any key to continue..............."; getch(); temp=num3; flag=old_calc; break; case 6: cout<<"nreturning to previous menu"; cout<<"npress any key to continue................"; getch(); break; case 7: cout<<"n quitting................."; cout<<"npress any key to continue..........."; getch(); exit(0); case 8: if(flag==new_calc) { cout<<"ninvalid choice"; cout<<"npress any key to continue............"; getch(); } else { temp=0; flag=new_calc; } break;
  • 15. default: cout<<"ninvalid choice"; cout<<"npress any key to continue.............."; getch(); break; } } while(choice2!=6); break; case 2: do { clrscr(); cout<<"=============Scientific calculator==============="; cout<<"n1tsquaren2tsquare rootn3tcuben4tpowern5tfactorialn6tsinn7tcosn8ttann9tlogrithmn10tnat ural logrithmn11texponentialn12treturn to previous menun13tquit"; if(flag==old_calc) cout<<"n14tclear memory"; cout<<"n choose type of the calculation :"; cin>>choice2; switch(choice2) { case 1: if(flag==new_calc) { cout<<"enter number to find square :"; cin>>num1; } else { num1=temp; cout<<"n number is "<<num1<<endl; } num3=scien_calc::square(num1); cout<<"nsquare of "<<num1<<"="<<num3; cout<<"npress any key to continue.............";
  • 16. getch(); temp=num3; flag=old_calc; break; case 2: if(flag==new_calc) { cout<<"enter number to find square root :"; cin>>num1; } else { num1=temp; cout<<"n number ="<<num1<<endl; } num3=scien_calc::sqrt_fun(num1); cout<<"nsquare of "<<num1<<"="<<num3; cout<<"npress any key to continue............."; getch(); temp=num3; flag=old_calc; break; case 3: if(flag==new_calc) { cout<<"enter to find cube"; cin>>num1; } else { num1=temp; cout<<"nnumber is "<<num1<<endl; } num3=scien_calc::cube(num1); cout<<"ncube of"<<num1<<"="<<num3; cout<<"npress any key to continue.........."; getch();
  • 17. temp=num3; flag=old_calc; break; case 4: if(flag==new_calc) { cout<<"enter the first number of base to find power"; cin>>num1; } else { num1=temp; cout<<"nfirst number is"<<num1<<endl; } cout<<"enter the second number for for to find power:"; cin>>num2; num3=scien_calc::power(num1,num2); cout<<"n"<<num1<<"^"<<num2<<"="<<num3; cout<<"npress any key to continue............"; getch(); temp=num3; flag=old_calc; break; case 5: if(flag==new_calc) { cout<<"enter number to find factorial:"; cin>>num1; } else { num1=temp; cout<<"n number to find factorial is"<<num1<<endl; } long int num4=scien_calc::fact(num1); cout<<"nfactorial of"<<num1<<" = "<<num4; cout<<"npress any key to continue..............."; getch();
  • 18. temp=num4; flag=old_calc; break; case 6: if(flag==new_calc) { cout<<"enter SIN "; cin>>num1; } else { num1=temp; cout<<"nnumber for sin value is"<<num1<<endl; } num3=scien_calc::sin_fun(num1); cout<<"nSIN"<<num1<<" = "<<num3; cout<<"npress any key to continue.............."; getch(); temp=num3; flag=old_calc; break; case 7: if(flag==new_calc) { cout<<"nenter COS "; cin>>num1; } else { num1=temp; cout<<"nnumber for cos value"<<num1<<endl; } num3=scien_calc::cos_fun(num1); cout<<"nCOS "<<num1<<"="<<num3; cout<<"npress any key to continue................"; getch(); temp=num3; flag=old_calc; break;
  • 19. case 8: if(flag==new_calc) { cout<<"enter TAN "; cin>>num1; } else { num1=temp; cout<<"nnumber for tan value"<<num1<<endl; } num3=scien_calc::tan_fun(num1); cout<<"nTAN "<<num1<<"="<<num3; cout<<"npress any key to continue.............."; getch(); temp=num3; flag=old_calc; break; case 9: if(flag==new_calc) { cout<<"enter LOG :"; cin>>num1; } else { num1=temp; cout<<"nnumber for log value"<<num1<<endl; } num3=scien_calc::log_fun(num1); cout<<"nLOG "<<num1<<"="<<num3; cout<<"npress any key to continue................."; getch(); temp=num3; flag=old_calc; break; case 10: if(flag==new_calc) { cout<<"enter LOG10 :"; cin>>num1; }
  • 20. else { num1=temp; cout<<"nnumber for natural log value"<<num1<<endl; } num3=scien_calc::log10_fun(num1); cout<<"nLOG10 "<<num1<<"="<<num3; cout<<"npress any key to continue................."; getch(); temp=num3; flag=old_calc; break; case 11: if(flag==new_calc) { cout<<"enter e^ :"; cin>>num1; } else { num1=temp; cout<<"nnumber for exponential value"<<num1<<endl; } num3=scien_calc::exp_fun(num1); cout<<"ne^"<<num1<<"="<<num3; cout<<"npress any key to continue................."; getch(); temp=num3; flag=old_calc; break; case 12: cout<<"nreturning to previous menu"; cout<<"npress any key to continue............."; getch(); break; case 13: cout<<"nQuitting..............";
  • 21. cout<<"npress any key to continue..............."; getch(); exit(0); case 14: if(flag==new_calc) { cout<<"ninvalid choice"; cout<<"npress any key to continue................."; getch(); } else { temp=0; flag=new_calc; } break; default: cout<<"invalid choice"; cout<<"press any key to continue..............."; getch(); break; } } while(choice2!=13); break; case3: cout<<"nQuitting.............."; cout<<"npress any key to continue............."; getch(); break; default: cout<<"ninvalid choice"; cout<<"n press any key to continue............."; getch(); break;} }while(choice1!=3);
  • 22. OUTPUT SCREEN MAIN SCREEN:- CHOOSE THE TYPE OF CALCULATOR
  • 23. SCIENTIFIC CALCULATOR SCREEN:- IN SCIENTIFIC CALCULATOR, CHOOSE THE TYPE OF FUNCTION. RESULT SCREEN:- FIND YOUR ANSWER
  • 24. BIBLOGRAPHY 1 HTTP://WWW.GOOGLE.COM/ 2 HTTP://EN.WIKIPEDIA.ORG 3 COMPUTER SCIENCE WITH C++ BY SUMITA ARORA 4 OBJECT ORIENTED PROGRAMMING BY ROBERT LAFORE 5 COMPUTER SCIENCE WITH C++ BY PREETI ARORA AND PINKY GUPTA 6 WWW.BOTSKOOL.COM