Download as pdf or txt
Download as pdf or txt
You are on page 1of 15

A

Micro Project Report


On
--Basic calculator Programming--
Under Subject: - Object Oriented programming using C++
Semester: III

Maharashtra State Board of Technical Education, Mumbai

Department of Computer Engineering


Matoshri Aasarabai Polytechnic, Eklahare, Nashik
Academic Year: 2022-23
Maharashtra State Board of Technical Education, Mumbai
Matoshri Aasarabai Polytechnic, Eklahare, Nashik

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.

Roll No Enrollment No. Exam Seat Name of Students


Number
15 2111700070 Dhikale Kirti Ashok
19 2111700074 Donde Pratik Rakesh
26 2111700082 Handge Shrushti Lalji
38 2111700096 Rajole Samruddhi Nana

Date:____________________ Place: Nashik.

Subject Teacher Head of Department Principal


(Mrs.S.Patel) (Prof.V.A.Sonavane) (Dr. Bagul. S.J.)
MATOSHRI AASARABAI POLYTECHNIC, EKLAHARE, NASHIK
Department of Computer Engineering

Academic Year 2022-23

Log Book for Micro- Project

Semester: Third Program: - Computer Engineering


Course: - Object oriented programming using C++ Course Code: - 22316
Topic of the Micro Project: Basic Calculator.

Sr.
Details Page No.
No.

1 Abstract

2 Introduction and Purpose

3 Materials and Methods

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)

Title of Micro Project: Basic Calculator Programming.


Group Members:
Roll Enrollment No. Exam Seat Number Name of Students
No
15 2111700070 Dhikale Kirti Ashok
19 2111700074 Donde Pratik Rakesh
26 2111700082 Handge Shrushti Lalji
38 2111700096 Rajole Samruddhi Nana
Sr. Criteria Marks Indicators for different level of Performance (Evaluation Scale 1 to 6)
No Obtained
(Out ) Poor (1-2) Average(3-4) Good(5-6)
1 Relevance to the Relate to some LOs Related to at least one CO Take care of at-least Two COs
course
2 Scientific Purpose &hypothesis not Prepared properly Purpose &hypothesis prepared properly,
approach properly mention, incomplete purpose &hypothesis, complete &accurate order logical set up.
order logical set up. complete order logical set consistent conclusion
up.
inconsistent conclusion
3 Content of Not relevant and sufficient Relevant and sufficient Relevant , sufficient for topic and well
project for topic organized
4 Knowledge of Incomplete Preliminary complete Preliminary Complete Preliminary research,
project area research, minimum research , knowledge of knowledge of related material, scope
knowledge of related &limitation.
related material
material
5 Thoroughness Incomplete data Sufficient research Sufficient research
&observation data observation data observation &original plan
6 Written record Prepared an improper report Prepared the report with Prepared appropriate format of the report
&Report with unsatisfactory content satisfactory content with sufficient content details

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)

Name and Signature of Guide:_________________________________________________


ANNEXURE II
Evaluation Sheet for the Micro Project

Academic Year: - 2022-2023 Semester: - Third


Course: - Object oriented programming using C++ Course Code: 22316
Name of Faculty: - Ms. S.Patel
Title of the Project: "Basic Calculator Programming".

Major Learning Outcomes achieved by students by doing the Projects:

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

15 2111700070 Dhikale Kirti Ashok


19 2111700074 Donde Pratik Rakesh
26 2111700082 Handge Shrushti Lalji
38 2111700096 Rajole Samruddhi Nana

(Name & Sign of Faculty)


ACKNOWLEDGEMENT

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.

We remain indebted to Prof. V. A. Sonvane, Head Humanities & Science Dept.,


for his suggestion and valuable guidance.

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

1. Calculators are widely used device nowadays. It makes calculations


easier and faster.

2. Calculators are used to everyone in daily life. A simple calculator can be


made using a C++ program which is able to add, subtract, multiply and
divide, two operands entered by the user.
3. The switch and break statement is used to create a calculator.
4. This program takes an arithmetic operator (+, -, *, /) and two operands
from a user and performs the operation on those two operands depending
upon the operator entered by the user.
5. A calculator is a portable device that helps to perform simple
mathematical calculations in our daily lives such as addition, subtraction,
division, multiplication, etc.
6. Some of the scientific calculators are used to perform complex calculation
more easily like square root, function, exponential operations, logarithm,
trigonometric function and hyperbolic function, etc.
7. In this section, we will create calculator program in C++ using function
and do-while loop.
Introduction
1. A calculator is a device that performs arithmetic operations on number.
Basic calculator can do only addition, subtraction, multiplication, division and
other 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. We use a scientific or sophisticated calculator in some situations, where we


need to solve complex calculations like trigonometry functions, exponential
operators, degrees, radians, log functions, hyperbolic functions etc. Let's discuss
the various ways to create a calculator program in the C language.

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.

2. 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.

3. It is also a program on a computer that simulates a hand-held


calculator. Calculator programs let you perform simple math calculations
without leaving the computer. The Apple Macintosh comes with a calculator
desk accessory. Likewise, Microsoft Windows includes a calculator accessory.
Material
To understand this example, you should have the knowledge of the following C++
programming topics:

C++ switch case Statement

C++ break Statement

C++ continue Statement

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.

 What are the benefits of using calculators?


This technology 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.
Secondly, they are saved from monotonous calculations and the same boring
mundane procedure

 What is the purpose of a variable in a calculator application?


Variables can be used in any equation and are substituted for their assigned
value. Variables can be inserted using the x button.

 What is the most important between a computer and a calculator?


A computer can perform any operation that a calculator is capable of
performing, but a calculator cannot carry out the logical and highly complex
problems. The reason behind this is that a computer can be programmed to
make decisions, but a calculator is not equipped with that technology.
ALGORITHM : -

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;

cout << "Enter operator: +, -, *, /: ";


cin >> op;

cout << "Enter two operands: ";


cin >> 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.

You might also like