Project Report ON Calculator by C++: Computer Science of Engineering of Ikg Punjab Technical University, Jalandhar

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

PROJECT REPORT

ON

CALCULATOR BY C++

BACHELOR OF TECHNOLOGY
IN
COMPUTER SCIENCE OF ENGINEERING

OF IKG PUNJAB TECHNICAL UNIVERSITY, JALANDHAR

SUBMITTED TO SUBMITTED BY

MRS. AMANDEEP KAUR HAVISHA BISHT


2002451

DEPARTMENT OF CSE, DEPARTMENT OF CSE,


CEC LANDRAN CEC LANDRAN
(I) INTRODUCTION

1.INTRODUCTION OF THE PROJECT:

C++ programming language was developed in 1980 by Bjarne Stroustrup at bell laboratories of AT&T
(American Telephone & Telegraph), located in U.S.A.

Bjarne Stroustrup is known as the founder of C++ language.

It was develop for adding a feature of OOP (Object Oriented Programming) in C without significantly
changing the C component.

What is C++?
 C++ is a cross-platform language that can be used to create high-performance applications.

 C++ was developed by Bjarne Stroustrup, as an extension to the C language.

 C++ gives programmers a high level of control over system resources and memory.

 The language was updated 3 major times in 2011, 2014, and 2017 to C++11, C++14, and C+
+17.
Why Use C++
 C++ is one of the world's most popular programming languages.

 C++ can be found in today's operating systems, Graphical User Interfaces, and embedded
systems.

 C++ is an object-oriented programming language which gives a clear structure to programs


and allows code to be reused, lowering development costs.

 C++ is portable and can be used to develop applications that can be adapted to multiple
platforms.

 C++ is fun and easy to learn!

 As C++ is close to C# and Java, it makes it easy for programmers to switch to C++ or vice
versa
2.TECHNOLOGY USED :
C++ tutorial provides basic and advanced concepts of C++. Our C++ tutorial is designed for beginners
and professionals.

C++ is an object-oriented programming language. It is an extension to C programming.

Our C++ tutorial includes all topics of C++ such as first example, control statements, objects and classes,
inheritance, constructor, destructor, this, static, polymorphism, abstraction, abstract class, interface,
namespace, encapsulation, arrays, strings, exception handling, File IO, etc.

Switch case:
The C++ switch statement executes one statement from multiple conditions. It is like if-else-if ladder
statement in C++.
3.OBJECTIVES OF PROJECT:

The key objectives of cpp are mentioned below:

1. To understand how C++ improves C with object-oriented features.


2. To learn how to write inline functions for efficiency and performance.
3. To learn the syntax and semantics of the C++ programming language.
4. To learn how to design C++ classes for code reuse.
5. To learn how to implement copy constructors and class member functions.
6. To understand the concept of data abstraction and encapsulation.
7. To learn how to overload functions and operators in C++.
8. To learn how containment and inheritance promote code reuse in C++.
9. To learn how inheritance and virtual functions implement dynamic binding with
polymorphism.
10. To learn how to design and implement generic classes with C++ templates.
11. To learn how to use exception handling in C++ programs.
4. ADVANTAGES OF CPP:

The advantages of CPP are as follows:

1) C++ is an object-oriented programming language. It may be a collection of commands, which tell the
pc to try to do “something.” This collection of commands is typically called C++ ASCII text files.
2) C++ could also be a problem-oriented language that’s much easier to use than the other low-level
languages like binary coding. It takes much more space than low-level languages but it’s much easier
to understand and learn.
3) C++ program has many advantages when it involves programming, All C++ program stand-alone
files must use the foremost function to allow the program to start out up and motivate its functions.
4) C++ program can support unions and structures that are a mix of stand-alone and put-together files, It
uses the standard C++ application mentioned as “.cpp”, C++ uses the reserved library word
mentioned as “goto” that’s the same as Java’s continue, or break commands.
5) The global data and global functions are used within C++ that aren’t utilized in many other high-level
languages within the pc sciences and it is an advantage to the programming languages.
6) As C++ doesn’t use the objects, it’s difficult to make the programs that have inheritance data and
thus the reformed the programs to contribute to the other data and therefore the programs, it is
possible to undertake to the present, however, but is difficult, These inheritance data and programs
are mentioned because of the inheritance trees.
7) C++ doesn’t support class methods that are faithful away, but class methods are basically functions,
and sometimes they’re referred to as functions.
8) C++ program uses multi-paradigm programming, Paradigm means the planning of programming,
paradigm concerned about the logic, the structure, and procedure of program, C++ program is multi-
paradigm means it follows three paradigms Generic, Imperative, Object-Oriented.
9) C++ program is useful for low-level programming language and really efficient for general purposes,
It offers performance and memory efficiently, It offers high-level abstraction, within the language of
the matter domain
10) C++ may be a system programming and features a relatively clear and mature standard,
11) C++ program supports inline function, C++ supports exception handling, it’s pointer and references,
C++ uses cin and cout.
(III) IMPLEMENTATION PHASE

Code of the calculator project is as follows:

#include <iostream>
using namespace std;
int main()
{
int n1, n2;
char op;
cout << "Enter 2 numbers: ";
cin >> n1 >> n2;
cout << "Enter operator: ";
cin >> op;
switch (op)
{
case '+':
cout << n1 + n2 << endl;
break;
case '-':
cout << n1 - n2 << endl;
break;
case '*':
cout << n1 * n2 << endl;
break;
case '/':
cout << n1 / n2 << endl;
break;
case '%':
cout << n1 % n2 << endl;
break;
default:
cout << "Operator not found!" << endl;
break;
}
return 0;
}
Screenshots of the project are as follows:
(IV) CONCLUSION

A program of calculator was made using c++ language. The implementation of switch operator was seen
and verified using different arithmetic operations.

(V) REFERENCES

1. www.youtube.com

2. www.geeksforgeeks.com

3. www.w3school.com

You might also like