D.Y.
PATIL TECHNICAL CAMPUS, TALSANDE
FACULTY OF ENGINEERING & FACULTY OF
MANAGEMENT
(Polytechnic)
A Micro project Report On
“CALCULATOR”
Submitted By
Enrollment No. Name
Guided By
Mrs.P.B.Kaslakar
D.Y.PATIL TECHNICAL CAMPUS, TALSANDE FACULTY
OF ENGINEERING & FACULTY OF MANAGEMENT
(Polytechnic)
DEPARTMENT OF COMPUTER ENGINEERING
SEMESTER III
CERTIFICATE
This is to Certify that student of Computer Engineering
has successfully completed the project term work “calculator” in
partial fulfillment of the Diploma of Engineering in Computer as laid
down during academic year 2024-25.
Roll No. Name of Student Exam Seat
Mrs.P.B. Ms.J.N.Gurav
Kasalkar HOD
Project Guide
Dr. S.R. Pawaskar
Principal
Date – / /
Place – Talsande
INDEX
Sr Title Page No.
No.
1 Introduction 1
2 Requirement 2
3 Program 3-6
4 Result 7-10
5 Conclusion 11
6 References 12
1. INTRODUCTION
1. A calculator is a device that performs arithmetic operations on number.Basic
calculator can do only addition, subtraction, multiplication, division andother
Mathematical calculations.
2. The most basic calculator is the four-function calculator, which can
perform basic arithmetic such as addition, subtraction, multiplication and
division.These are sometimes called pocket calculators or hand-held electronic
calculators because they are small enough to fit in a shirt pocket.
3. The switch case is a powerful control structure in c++ that allows for
clear and organized handling of multiple conditions, making it ideal for
this type of calculator program.
4. By using switch, we can direct the program to execute the appropriate
function for each oprator(such as +,-,* or /), ensuring that the code
remains easy to read and maintain. This structure also helps to handle
invalid oprations,enhancing the program’s robustness.
5. This project serves as a practical example of using the switch case to
manage multiple decision paths effectively in c++, while also showcasing
essential programming concepts like classes, functions and basic error
handling.
2. REQUIREMENT
1. Computer System
Secification :-Any desktop
Quantity :1
2. Operating System
Specification:-Windows
Quantity :1
3. Software
Specification:-Turbo c++ version 3.0
Quantity :1
3. PROGRAM
#include<iostream.h>
#include<conio.h>
#include<stdlib.h>
class calculator
public:
float Addition, substraction, multiplication, division, square,cube, average;
void add (float a,float b)
Addition=a+b;
cout<<"ADDITION: "<<Addition<<endl;
void sub(int c,int d)
substraction=c-d;
cout<<"SUBSTRACTION: <<substraction<<endl;
void mul(int e, int f)
multiplication=e*f;
cout<<"MULTIPLICATION: "<<multiplication<<endl;
}
void div(int g, int h)
Division=g/h;
cout<<"DIVISION: "<<division<<endl;
void squ(int i)
square=i*i;
cout<<"SQUARE: "<<square<<endl;
void cub(int j)
cube=j*j*j;
cout<<"CUBE:"<<cube<<endl;
void avg(int k, int l)
int divisor, divisible;
average k/l;
cout<<"AVERAGE:"<<average<<endl;
}
};
void main()
clrscr();
calculator c;
int choice;
cout<<*******THIS IS A PROJECT OF SIMPLE CALCULATOR********
do
cout<<” “<<endl;
cout<<"Enter Your choice: "<<endl<<"1 ADDITION"<<endl<<"2
SUBSTRACTION"<<endl<<”3MULTIPLICATION”<<endl<<”4
DIVISION"<<endl<<"5 SQUARE"<<endl<<"6 CUBE"<<endl<<"7
AVERAGE"<<endl<<"8 Exit"<<end1;
cin>>choice:
switch(choice)
case 1:
float A,B;
cout<"Enter value of A:"<<endl;
cin>>A:
cout<<"Enter The Value Of B:"<<endl;
cin>>B:
c.add(A,B);
cout<<" -------------------------------------------------------------------- “<<endl;
break;
case 2:
int C,D;
cout<<"Enter value of C:"<<endl;
cin>>C;
cout<<"Enter Value Of D:"<<endl;
cin>>D;
c.sub(C,D);
cout<<" ---------------------------------------- “<<endl;
break;
case 3:
double E,F;
cout<<"Enter value of E:"<<endl;
cin>>E;
cout<<"Enter Value of F:"<<endl;
cin>>F;
c.mul(E,F);
cout<<" ------------------------------------------------------------------------ “<<endl;
break;
case 4:
int G,H;
cout<<"Enter the value of G:"<<endl;
cin>>G;
cout<<"Enter The Value of H:"<<endl;
cin>>H;
c.div(G,H);
cout<<” ----------------------------------------- “<<endl;
break;
case 5:
int I;
cout<<"Enter the value of I:";
cin>>I;
c.squ(I);
cout<<" ---------------------------------------- “<<endl;
break;
case 6:
int J;
cout<<"Enter the value of j:";
cin>>J;
c.cub(J);
cout<<" --------------------------------------------------------------------------- “<<endl
break;
case 7:
int K,L;
cout<<"Enter value for diviser:";
cin>>K;
cout<<"Enter value of divisible:";
cin>>L;
c.avg(K,L);
cout<<” ----------------------------------------- “<<endl;
break;
case 8: exit(0);
default:cout<<"Enter Correct Choice";
}while(choice!=4);
getch();
}
4. RESULT :
5. CONCLUSION :
This c++ calculator program demonstrates the implementation of basic
arithmetic oprations using fundamental programming concepts. By employing
classes to encapsulate functionality and a switch case structure to handle user
selected oprations, this project provides a clear, modular, and maintainable
approach to solving a common programming problem.
6. REFEREANCE :
1. https://www.scribd.com/document/610574138/Oop
2. https://openai.com/index/chatgpt/