A Micro Project Report On - Basic Calculator Programming
A Micro Project Report On - Basic Calculator Programming
CERTIFICATE
This is to certify that following students of THIRD SEMESTER Diploma
Engineering Program in Computer Department have successfully completed the
Micro-Project"Basic Calculator Programming". under my supervision, in the partial
fulfillment of Course Object Oriented Programming (22102) for Academic Year
2021-2022 as per prescribed in the MSBTE “ I-Scheme” curriculum.
Sr.
Details Page No.
No.
1 Abstract
4 Theoretical Background
5 Code
Conclusion
6
Signature of Faculty
ANNEXURE I
Rubric for Evaluation of Micro Project of Object oriented programming using C++
(22316)
7 Ingenuity & Common ideas, explanation Good ideas, clear Unique ideas, clear explanation, proper
creativity not clear explanation use of material
8 Visual missed details and Included key points but Presented with the help of power point,
Presentation considerable information lacks considerable Highlighted key points, accurate and
information considerable information
9 Resources/ Not referred more than two Referred at-least 3 Referred at –least 5 relevant sources, 3
References sources, very old reference relevant sources, at least 2 most latest
Total:
Converted
(Out of 6)
a) Practical Outcomes:-
_______________________________________________________________.
_______________________________________________________________.
b) Unit Outcomes in Cognitive Domain:-
_______________________________________________________________.
c) Outcomes in Affective Domain:-
_______________________________________________________________.
Comment /Suggestion about team work /Leadership/ Inter-personal communication
___________________________________________________________________.
Marks out of
Marks out of (03)
(02)for Total
Roll for performance in
Enrollment No. Exam Seat No. Student Name performance in marks out
No. group
oral/presentation of (05)
activity
activity
With deep sense of gratitude we would like to thanks all the people who have lit
our path with their kind guidance. We are very grateful to these intellectuals who
did their best to help during our project work.
It is our proud privilege to express deep sense of gratitude to, Dr. S. J. Bagul
Principal of Matoshri Aasarabai Polytechnic, Eklahare, Nashik, for his
comments and kind permission to complete this Micro Project.
The special gratitude goes to our internal guide Ms. S. Patel technical staff
members, and non-technical staff members, of Computer Tech. Department for
their expensive, excellent and precious guidance in completion of this work.
Name of Students:
1. Dhikale Kirti Ashok
2. Donde Pratik Rakesh
3. Handge Shrushti Lalji
4. Rajole Samruddhi Nana
Abstract
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.
Purpose
1. Calculators are simply a tool students use to help solve problems. Since
they eliminate tedious computations and algebraic manipulations that
discourage many students, calculators allow more students to solve problems
and appreciate the power and value of mathematics in the world today.
Method
.This program takes an operator and two operands from the user.
.The operator is stored in variable op and two operands are stored in num1 and num2
respectively.
.Then, switch...case statement is used for checking the operator entered by user.
.If user enters + then, statements for case: '+' is executed and program is terminated.
.If user enters - then, statements for case: '-' is executed and program is terminated.
.His program works similarly for the * and / operators. But, if the operator doesn't
matches any of the four character [+, -, * and /], the default statement is executed which
displays error message.
Theoretical Background
What is a calculator?
A calculator is a device that performs arithmetic operations on numbers. Basic
calculators can do only addition, subtraction, multiplication and division mathematical
calculations.
However, more sophisticated calculators can handle exponential operations, square roots,
logarithms, trigonometric functions and hyperbolic functions. Internally, some calculators
perform all these functions by repeated addition processes.
The evolution of the calculator
Most calculators these days require electricity to operate or are battery-powered
calculators. Calculators work by performing programmed functions based on numerical
inputs.
Before the electronic calculator (circa 1970), a more primitive calculator, the slide rule,
was commonly used. It consisted of a slat of wood called the slide that could be moved in
and out of a reinforced pair of slats. Both the slide and the outer pair of slats had
calibrated numerical scales.
Step 1: Start
Step 2: The operator is stored in variable op and two operands are stored in num1 and num2 respectively.
Step 3: Then, switch...case statement is used for checking the operator entered by user.
Step 4: If user enters + then, statements for case: '+' is executed and program is terminated.
Step 5: If user enters - then, statements for case: '-' is executed and program is terminated.
Step 6: This program works similarly for the * and / operators. But, if the operator doesn't matches any of the four character
[ +, -, * and / ], the default statement is executed which displays error message.
Step 7: End
FLOW CHART :-
Coding:
# include <iostream>
using namespace std;
int main() {
char op;
float num1, num2;
switch(op) {
case '+':
cout << num1 << " + " << num2 << " = " << num1 + num2;
break;
case '-':
cout << num1 << " - " << num2 << " = " << num1 - num2;
break;
case '*':
cout << num1 << " * " << num2 << " = " << num1 * num2;
break;
case '/':
cout << num1 << " / " << num2 << " = " << num1 / num2;
break;
default:
// If the operator is other than +, -, * or /, error message is shown
cout << "Error! operator is not correct";
break;
}
return 0;
}
Output:
Enter operator: +, -, *, /: - +
Enter two operands: 22 + 22
22 + 22 = 44
Some Reference Images
Conclusion
In this work we have developed a calculator for exact real number computation and performed a
theoretical analysis of the algorithms and experimented on their implementation.
We began by defining two representations of real’s in the range [-1, 1] using streams of digits. These
were then extended to represent real numbers on the whole real line using a (mantissa, exponent) style
representation. We showed how to convert between these representations, how to convert decimal
numbers into a signed binary representation, and how to convert a finite portion of the signed binary
representation back into decimal.
Algorithms for the basic arithmetic operations were implemented for these representations. A
number of different techniques are used to obtain these algorithms, including exploiting the relationship
between the list operation `cons' and numerical average, using certain identities, and analysing of the range
of possible values of a stream starting with a given digit or sequence of digits.
We developed an algorithm for the direct multiplication of two streams of signed binary digit. This is
a more complex operation than the multiplication of dyadic digit streams, but avoids the problem of dyadic
digit swell which can be observed if the dyadic digit multiplication is used to compute iterations of the
logistic map, for example, and which can cripple performance.
We also developed an algorithm for the division of two signed binary numbers. This is significantly more
complicated than the familiar school long division method because in the school long division method we
know the whole denominator, whereas when dividing by a number with an infinite representation this is not
the case. Other approaches such as Fourier's cross-division method (a description of which can be found in
[30] p.159-164) which examine the denominator from right to left are also unsuitable because they allow
digits which have already been output to be `corrected' later on, and hence each output digit depends on an
infinite number of digits of the numerator and denominator.