You are on page 1of 17

lOMoARcPSD|15602052

CSE343Summer Training Report 11905427

Summer Training (Lovely Professional University)

StuDocu is not sponsored or endorsed by any college or university


Downloaded by Nilesh Kumar Choudhary (nileshkchy06@gmail.com)
lOMoARcPSD|15602052

SUMMER INTERNSHIP

On

C++ Basics: Selection and Iteration

Submitted by

Name: Saksham Sharma


Registration No:11905427
Programme: B.Tech CSE

Under the Guidance of

Coursera

School of Computer Science & Engineering


Lovely Professional University, Phagwara

(January-February, 2022)

Downloaded by Nilesh Kumar Choudhary (nileshkchy06@gmail.com)


lOMoARcPSD|15602052

DECLARATION

I hereby declare that I have completed summer internship at Coursera from January 2022
to February 2022. I have declare that I have worked with full dedication during training and
my learning outcomes fulfill the requirements of training for the award of degree of
BTech CSE (Relevant Degree), Lovely Professional University, Phagwara.

Saksham Sharma
11905427

Date: 28/02/2022

Downloaded by Nilesh Kumar Choudhary (nileshkchy06@gmail.com)


lOMoARcPSD|15602052

ACKNOWLEDGEMENT

I would like to express my special thanks of gratitude to Coursera who gave me a golden opportunity
to do Course project and also provided support in completing in my project.

I would also like to extend my gratitude to our Lovely Professional


University for providing me with all the facilities that were required.

Saksham Sharma
11905427

Downloaded by Nilesh Kumar Choudhary (nileshkchy06@gmail.com)


lOMoARcPSD|15602052

CERTIFICATE

Link- https://coursera.org/verify/Q7RHA9BQGSH9

Downloaded by Nilesh Kumar Choudhary (nileshkchy06@gmail.com)


lOMoARcPSD|15602052

TABLE OF CONTENTS

1. INTRODUCTION
2. TECHNOLOGY LEARNT
3. REASON FOR CHOOSING THIS TECHNOLOGY
4. LEARNING OUTCOME FROM TRAINING/TECHNOLOGY
LEARNT.

INTRODUCTION

C++ is a general-purpose programming language created by Bjarne Stroustrup as an extension


of the C programming language, or "C with Classes". The language has expanded significantly
over time, and modern C++ now has object-oriented, generic, and functional features in addition
to facilities for low-level memory manipulation. It is almost always implemented as a compiled
language, and many vendors provide C++ compilers, including the Free Software Foundation,
LLVM, Microsoft, Intel, Oracle, and IBM, so it is available on many platforms.

C++ was designed with a bias toward system programming and embedded, resource-constrained
software and large systems, with performance, efficiency, and flexibility of use as its design
highlights. C++ has also been found useful in many other contexts, with key strengths being
software infrastructure and resource-constrained applications, including desktop applications,
video games, servers (e.g. e-commerce, Web search, or SQL servers), and performance-critical
applications (e.g. telephone switches or space probes).

Downloaded by Nilesh Kumar Choudhary (nileshkchy06@gmail.com)


lOMoARcPSD|15602052

C++ is standardized by the International Organization for Standardization (ISO), with the latest
standard version ratified and published by ISO in December 2017 as ISO/IEC 14882:2017
(informally known as C++17). The C++ programming language was initially standardized in
1998 as ISO/IEC 14882:1998, which was then amended by the C++03, C++11 and C++14
standards. The current C++17 standard supersedes these with new features and an enlarged
standard library. Before the initial standardization in 1998, C++ was developed by Danish
computer scientist Bjarne Stroustrup at Bell Labs since 1979 as an extension of the C language;
he wanted an efficient and flexible language similar to C that also provided high-level features
for program organization. Since 2012, C++ is on a three-year release schedule, with C++20 the
next planned standard (and then C++23).

Object-oriented design centers on finding an appropriate set of classes and defining their
contents and behavior. It involves determining the proper use set of classes and then filling in
the details of their implementation. Object-oriented design is fundamentally a three-step process:
identifying the classes, characterizing them, and then defining the associated actions.

In this internship, you will discover how to create modular, flexible and reusable software, by
applying object oriented design principles and guidelines. On completion of this internship, you
will have solid knowledge of methods and techniques in Object Oriented Design and
Programming.

Downloaded by Nilesh Kumar Choudhary (nileshkchy06@gmail.com)


lOMoARcPSD|15602052

TECHNOLOGY LEARNT
The Technology/terms that I had learnt from this course are:
1. Classes and Objects
2. Relationships between
classes
3. Inheritance
4. Polymorphism
5. STL library
6. Exception Handling
7. File Handling
8. String Handling

REASON FOR CHOOSING THIS TECHNOLOGY

C++ is a general-purpose, object-oriented programming language that was designed by Bjarne


Stroustrup in 1979 to be an extension of the C language. It has the features of imperative, object-
oriented as well as generic programming models. C++ also has some additional facilities to those
in C such as classes, inheritance, default function argument, etc.

C++ plays quite an integral role in modern times as many contemporary systems such as
operating systems, web browsers, databases, etc. have C++ code in at least some part of their
codebase. Moreover, C++ is quite useful in performance critical areas because of its speed.

Downloaded by Nilesh Kumar Choudhary (nileshkchy06@gmail.com)


lOMoARcPSD|15602052

Reason Why I choosed this course is because of:


1. C++ Popularity and High Salary
C++ is one of the most popular languages in the world. It is used by some
4.4 million developers worldwide. Also, C++ Developers are quite sought after and they hold
some of the most high-paying jobs in the industry with an average base pay of $103, 035 per
year.

2. C++ has Abundant Library Support


C++ has the Standard Template Library(STL) that is very useful as it helps
in writing code compactly and quickly as required. It contains mainly four components i.e.
algorithms, containers, functions, and iterators.

3. C++ has a Large Community


There is a large online community of C++ users and experts that is
particularly helpful in case any support is required. There is a lot of resources like
GeeksforGeeks etc. available on the internet regarding C++. Some of the other online resources
for C++ include StackOverflow, cppreference.com, Standard C++, etc.

4. C++ In Databases
There are many modern day databases such as MySQL, MongoDB,
MemSQL, etc. that are written in C++. This is because C++ is quite modern and it supports
features like exceptions, lambda expressions, etc. Many of the databases that are written in C++
are used in almost all of the in-use applications such as YouTube, WordPress, Twitter, Facebook,
etc.

5. C++ In Operating Systems


All the major operating systems such as Windows, Linux, Android,
Ubuntu, iOS, etc. are written in a combination of C and C++. The Windows applications are
written in C++, while Android applications are written in Java along with C/C++ with non-

Downloaded by Nilesh Kumar Choudhary (nileshkchy06@gmail.com)


lOMoARcPSD|15602052

default run-times for C++ support. Also, C++ can be used to develop the core of the applications
in iOS.
In general, C or C++ are used in operating systems because of the speed and strongly typed
nature of these languages.

6. C++ In Compilers
C++ is closer to the hardware level and is a comparatively low-level
language. Because of this reason, it is used in many compilers as a backend programming
language. An example of this is the GNU Compiler Collection (GCC) which is currently written
mostly in C++ along with C.

7. C++ In Web Browsers


A lot of web browsers are developed using C++ such as Chrome,
Firefox, Safari, etc. Chrome contains C++ in the rendering engine, JavaScript engine, and the
UI. Firefox uses mainly in the rendering engine and a little in the UI. Safari also uses C++ in the
rendering engine and JavaScript engine.

All these web browsers and more use C++, particularly in the rendering engines because it
provides the required speed that is necessary for the rendering engines since they need to display
the content at an accelerated rate.

8. C++ In Graphics
Applications requiring graphics such as digital image processing,
computer vision, screen recording programs, etc. use C++ due to its high speed. This can also
include different games that have graphics as a big part of their structure.

9. C++ In Embedded Systems


C++ is closer to the hardware level and so it is quite useful in embedded
systems as the software and hardware in these are closely coupled. There are many embedded
systems that use C++ such as smart watches, MP3 players, GPS systems, etc.

Downloaded by Nilesh Kumar Choudhary (nileshkchy06@gmail.com)


lOMoARcPSD|15602052

10. C++ is Portable


Programs developed in C++ can be moved from one platform to
another. This is one of the main reasons that applications requiring multi-platform or
multi-device development often use C++.

LEARNING OUTCOME FROM TRAINING/TECHNOLOGY LEARNT

Object-oriented design centers on finding an appropriate set of classes and defining their
contents and behavior. It involves determining the proper use set of classes and then filling in
the details of their implementation. Object-oriented design is fundamentally a three-step process:
identifying the classes, characterizing them, and then defining the associated actions.

In this internship, you will discover how to create modular, flexible and reusable software, by
applying object oriented design principles and guidelines. On completion of this internship, you
will have solid knowledge of methods and techniques in Object Oriented Design and
Programming.

Learnt from Terms:


1. Classes and Objects
C++ is arguably the most versatile language in common use. C++
allows for both high-performance code as well as expressive abstractions and design constructs.
C++'s greatest strength is how scalable it could be, so apps that are very resource intensive are
usually built with it. A member function of a class may be a function that has its definition or its
prototype inside the class definition like several other variable. It operates on any object of the
class of which it's a member, and has access to all or any the members of a class for that object.
A friend function of a class is outlined outside that class' scope however it has the right to access

Downloaded by Nilesh Kumar Choudhary (nileshkchy06@gmail.com)


lOMoARcPSD|15602052

all private and protected members of the class. You would study member functions and friend
function in C++. Relationships between classes are as vital as the classes themselves. Certainly,
developers ought to be aware of classes — cars and roads, students and universities and also the
relationships that exist between them — cars drive on roads, students are educated at
universities. We explore however relationships may be given an equivalent status as classes.
Constructors are special class functions that performs initialization of each object. The Compiler
calls the constructor whenever an object is created. Constructors initialize values to object
members once storage is allocated to the object. we'll study constructors and destructors in C++.

We should be aware of:

What is a Class from an Object oriented programming standpoint?


What is an Object ?
What does a Class contain ?
How to create an Object ?
How to access data members of a class using Object?
What is Encapsulation?
What are access specifiers?
Accessing Public Data Members
Accessing Private Data Members
Accessing Protected Data Members
Member Functions
Friend Function in C++
What is a relationship and how its established between classes?
Association relationship
Aggregation relationship
Composition relationship
How does cardinality play a role in relationships.
What are Junction tables?

Downloaded by Nilesh Kumar Choudhary (nileshkchy06@gmail.com)


lOMoARcPSD|15602052

Constructors
Parameterized Constructors
Constructor Overloading
Constructors in array of objects
Constructors with default arguments
Dynamic memory allocation
Array of pointer to objects
Copy Constructor
Friend function and Friend classes
Destructors

you got to have learned regarding classes and Objects, access specifier and Getters and Setters
in C++. Let's use this iExplore section to seek out higher by responsive queries.
So far, we've got information on the necessities of Basic OOPs concepts, classes & Objects. Let's
quickly try few programming exercises, on the basics. We'll begin with creating changes on
some existing code snippets.
To standardize and ease out the coding method, you'd be supplied with some model code. The
problems would target making classes & Objects, writing getters & setters, writing standard code
by defining methods logical implementations. At the tip of the programming session, you must
have a smart grip over making classes, defining attributes, writing little standard
implementations. Also Some Application Programs to go into more deeper into subject.

2. Relationships between classes


Relationships between classes are as vital as the classes
themselves. Certainly, developers ought to be aware of classes — cars and roads, students and
universities and also the relationships that exist between them — cars drive on roads, students
are educated at universities. In this module, we tend to explore however relationships may be
given an equivalent status as classes. At the end of this session, you should be aware of: What
is a relationship and how its established between classes? Association relationship Aggregation

Downloaded by Nilesh Kumar Choudhary (nileshkchy06@gmail.com)


lOMoARcPSD|15602052

relationship Composition relationship How does cardinality play a role in relationships. What
are Junction tables?
Let's commit to answer some quiz queries to strengthen your knowledge with respect to
numerous relationships and its properties. Theoretically, these concepts appear easier to grasp
and look ostensibly uncomplicated. However, representing them in C++ code would appear to a
frightening task at the start. The main target would revolve around distinguishing the attributes
concerned in relationships yet as representing the cardinality. Also Some Application Programs
to go into more deeper into subject.
3. Inheritance
Inheritance could be a way to utilize once written code again and
again. The class that is inherited is termed base class and therefore the class that inherits is termed
derived class. So when, a derived class inherits a base class, the derived class will use all the
functions that are outlined in base class, therefore creating code reusable. This session would
introduce you to the way to implement the idea of Inheritance in C++.In this, we seek out higher
by responsive queries. Various Code Samples would be present helping you to higher understand
the ideas from implementation posture. Concentrate towards the implementation of overloading.
The problems would target implementing Inheritance in C++ and method overriding. At the tip
of the programming session, you need to have a wise grip over implementing Inheritance. Also
Some Application Programs to go into more deeper into subject.
you should be aware of:
What is Inheritance?
How Inheritance is implemented in C++?
Different types of Inheritance & its code implementation
How to access constructor and methods of a base class?
What is method overriding?
4. Polymorphism
Polymorphism may be a method of representing one kind
in many ways. Example Your behaviour that's, you behave differently with different person in
several places I mean, to parents you will be smart son, and to a friend you're a buddy and to
lecturers you show some respect. Here your behaviour goes on dynamical with folks you meet.
Abstraction is that the method of showing essential info to user and conceal the rest Example :

Downloaded by Nilesh Kumar Choudhary (nileshkchy06@gmail.com)


lOMoARcPSD|15602052

suppose you've got an automotive, and you're riding it currently, once you apply break you
recognize that automotive gone a stop however you do not know what's the process happened
once you applied break. You would learn the C++ implementations of the on top of concepts
and additionally the eventualities these ideas would assist you model a much better style. In this
we can trengthen your knowledge with respect to Polymorphism and Abstract Classes. . We'll
begin with creating changes on some existing code snippets, so we tend to conjointly get a good
plan on how Polymorphism and Abstract Classes are implemented in C++ for varied situations.
Numerous problems from the application domain would be out there for follow. Apart from
coding them, you must additionally attempt to modify yourself to spot these eventualities in
alternative applications once you begin coming up with and programming. Also Some
Application Programs to go into more deeper into subject.

you should be aware of:


What is Polymorphism and their types?
Function Overloading
Virtual Functions
Pure Virtual Functions
What is Abstract Class?
5. STL library
The standard template Library (STL) could be a package library for
the C++ programming language that influenced several elements of the C++ Standard Library.
The STL achieves its results through the employment of templates. This approach provides
compile-time polymorphism that's usually a lot of economical than ancient run-time
polymorphism. Modern C++ compilers are tuned to reduce abstraction penalties arising from
significant use of the STL. At the end of this session, you should be aware of: Understand the
necessity of collections, Explore varied STL containers, The way to use List and its methods,
The way to use Set and its methods, The way to use Map and its methods. Since there are several
utility methods out there as a part of these Standard Template Library, it's not humanly attainable
to recollect or explore all the methods. We'll begin with making changes on some existing code
snippets, so we tend to collectively get a decent set up on a way to create / initialize a collection
and perform CRUD [Create — read — Update — Delete] operations on the collection. We write

Downloaded by Nilesh Kumar Choudhary (nileshkchy06@gmail.com)


lOMoARcPSD|15602052

programs supported Collections in C++. Showcase your skills in solving the problems by using
Standard Template Library(STL) and also the accessible API strategies. Also Some Application
Programs to go into more deeper into subject.

6. Exception Handling
Exception handling is used when the frequency of occurence
of an exception cannot be predicted.
For example, arithmetic exceptions such as division by zero and operating systems use exception
handling to resolve deadlocks, recover from crash and so forth. We get the conceptual
information on exceptions. These queries would provide you with clarity on how exception
handling is enforced in C++. Various Code Samples would be present helping you to higher
understand the ideas from implementation posture. The iDesign part permits you to experiment
and code varied catch scenarios at the start by exploiting the exception classes offered. You may
finally find yourself writing your exception and handling it in your code. Also Some Application
Programs to go into more deeper into subject.
you should be aware of:
What is Exception handling?
Throwing Exception
Catching Exception
Standard Exceptions in C++
Creating custom exceptions.
7. File Handling
File reading and writing form an integral part of any application.
From simple logging to store Objects and Content, file processing plays a key role. C++ has a
very well crafted library referred to as fstream for File processing. This library provides data
types for file handling in C++. We seek out higher by responsive queries. Take a glance to
explore & learn by trying to hunt out answers. Its time to showcase your skills in solving the
problems by using appropriate API methods. Also Some Application Programs to go into more
deeper into subject.
you should be aware of fstream library and the data types it provides

Downloaded by Nilesh Kumar Choudhary (nileshkchy06@gmail.com)


lOMoARcPSD|15602052

Creating/Opening a File
Writing to a File
Reading from a File
Closing a File
Special Operations in a File
8. String Handling
We will Understand what strings are. Understand how to
declare a string. Understand how a string is stored in memory. we will Understand the string
functions defined in string header file. we will Understand the string classes in c++ we will
explore strings in detail. How to declare strings? How to work with strings? How to use
predefined string handling functions? let us take a look at the code samples to gain a
better understanding of strings. In particular, let us learn to handle strings and their
operations. String is an array of characters. In this session, we will solve programming
problems that involve extensive string processing. we will solve programming problems that
involve C++ string classes. Also Some Application Programs to go into more deeper into
subject.

Thank You,
Saksham Sharma, 11905427.

Downloaded by Nilesh Kumar Choudhary (nileshkchy06@gmail.com)

You might also like