Begin With C/C++: Programming Pathshala A Training Report
Begin With C/C++: Programming Pathshala A Training Report
Begin With C/C++: Programming Pathshala A Training Report
Programming Pathshala
A training report
B.tech(CSE)
Submitted to
PHAGWARA, PUNJAB
SUBMITTED BY
Name of student:
Jiya
Registration
Number:12109727
Signature of
the student:
DECLARATION
I hereby declare that I have completed my six weeks summer training at Programming
pathshala platform from June 2,2023 to July 14,2023 . I have declare that I have worked
full dedication during there 6 weeks of training and my learning outcomes fulfill the
requirements of training for the award of degree of B.tech. CSE , Lovely Proffesional
University, Phagwara.
I would like to express my gratitude towards my University as well as Programming pathshala for
providing me the golden opportunity to do this wonderful summer training regarding C++,which also
helped me in doinga lot of homework and learning.As a result, I came to know about so many new
things. So, I am really thank full to them.
Moreover I would like to thank my friends who helped me a lot whenever I got stuck in some problem
related to my course. I am really thankfull to have such a good support of them as they always have
my back whenever I need.
Also,I would like to mention the support system and consideration of my parents who have always
been there in my life to make me choose right thing and oppose the wrong. Without them I could
never had learned and became a person who I am now.
I have taken efforts in this project. However, it would not have been possible without the kind
support and help of many individuals and organizations. I would like to extend my sincere thanks to
all of them.
SUMMER TRAINING CERTIFICATE BY
Programming Pathshala
S. No. Title
1 Introduction
2 Technology Learnt
5 Bibliography
INTRODUCTION
Object: Objects are basic run-time entities in an object-oriented system, objects are instances of a class
that are user defined data types.
E.g.:
class person
char name
public:
void getdetails ()
{}
};
int main ()
{
Objects take up space in memory and have an associated address like a record in pascal or structure or
union in C.
When a program is executed the objects interact by sending messages to one another.
Each object contains data and code to manipulate the data. Objects can interact without having to
know details of each other's data or code, it is sufficient to know the type of message accepted
and type of response returned by the objects.
Class: Class is a blueprint of data and functions or methods. Class does not take any
space. syntax for class:
class class_name
private:
};
Class is a user defined data type like structures and unions in C.
By default class variables are private but in case of structure it is public. In the above example a
person is a class.
1. Encapsulation
Encapsulation is an OOP technique of wrapping the data and code. In this OOPS concept,
the variables of a class are always hidden from other classes. It can only be accessed using
the methods of their current class. For example - in school, a student cannot exist without a
class..
WHY ENCAPSULATION?
● It is considered good practice to declare your class attributes as private (as often as you can).
Encapsulation ensures better control of your data, because you (or others) can change one part
of the code without affecting other parts
● Increased security of data
2. Abstraction
Data abstraction refers to, providing only needed information to the outside world and hiding
implementation details. For example, consider a class Complex with public functions as getReal() and
getImag(). We may implement the class as an array of size 2 or as two variables. The advantage of
abstractions is, we can change implementation at any point, users of Complex class won’t be
affected as our method interface remains the same. Had our implementation be public, we would
not have been able to change it.
3. Inheritance
Inheritance is the process by which objects of one class acquire the properties of objects of another
class. It supports the concept of hierarchical classification. Inheritance provides reusability. This means
that we can add additional features to an existing class without modifying it.
WHY AND WHEN TO USE INHERITANCE?
● It is useful for code reusability: reuse attributes and methods of an existing class when you create a
new class.
● Multilevel Inheritance and Multiple Inheritance are the two types of Inheritance Classes.
4. Polymorphism
Polymorphism means the ability to take more than one form. An operation may exhibit different
behaviors in different instances. The behavior depends upon the types of data used in the operation.
Operator overloading is the process of making an operator to exhibit different behaviors in different
instances is known as operator overloading.
Function overloading is using a single function name to perform different types of tasks.
polymorphism is extensively used in implementing inheritance.
For example, think of a base class called Animal that has a method called animalSound(). Derived
classes of Animals could be Pigs, Cats, Dogs, Birds - And they also have their own implementation of
an animal sound (the pig oinks, and the cat meows, etc.
REASON FOR CHOOSING C++
All of the above was part of my training during my summer break I specially choose the
C++ from Programming Pathshala for reasons stated below :
Learning Outcomes
The learning outcomes of this course are:
C++ in Depth
● Character set
● Identifiers
● Keyword
● Data types
• Character set
The character set of C represents alphabet, digit or any symbol used to represent information.
Types Character Set
Uppercase Alphabets A, B, C, … Y, Z
Lowercase Alphabets a, b, c, … y, z
Digits 0, 1, 2, 3, … 9
• Identifiers
Identifiers are the fundamental building blocks of a program
data. They are user-defined names and consist of a sequence of letters and
digits
• Keywords
Keywords are those words whose meaning is already defined by Compiler. These keywords cannot be
used as an identifier. Note that keywords are the collection of reserved words and predefined
identifiers. Predefined identifiers are identifiers that are defined by the compiler but can be changed
inmeaning by the user.
For example, you could declare a variable called main inside your main function, initialize it, and then
print out its value (but ONLY do that to verify that you can!). On the other hand, you could not do this
with a variable named else. The difference is that else is a reserved word, while main is "only" a
predefined identifier.
There are a total of 95 reserved words in C++. The reserved words of C++ may be conveniently placed
into several groups. In the first group, we put those that were also present in the C programming
language and have been carried over into C++. There are 32 of these.
There are another 30 reserved words that were not in C, are therefore new to C++ programming
language.
• Data Type
Data type means the type of value a variable will have.
It also defines memory space for a particular variable in the computer.
OPERATORS:
1. Arithmetic operator
2.Unary operator
3.Relational operator
4.Logical operator
5.Assignment operator
6.Conditional operator
7.Bitwise operator
8.Special operator
• Arithmetic Operators
• Unary Operator
• Relational Operator
It compares two operands depending upon their relation. Expression generates zero(false) or
nonzero(true) value.
Ex.>, <, =, <=,>= etc...
• Logical Operator
It checks the logical relationship between two expressions and the result is zero(false) or
nonzero(true).
• Assignment Operator
They are used to assign the result of an expression on the right side to a variable on the left side.
• Conditional Operator
Conditional operator contains condition followed by two statements. If the condition is true the first
statement is executed otherwise the second statement.
• Bitwise Operator
Logical Table
0 0 0 0 0
0 1 0 1 1
1 1 1 1 0
1 0 0 1 1
Arrays:
● To declare an array
● To initialize an array
● To pass an array to a function
Introduction
● Arrays
– Collection of related data items of the same data type.
– Static entity – i.e. they remain the same size throughout program execution
● Array
–Group of consecutive memory locations
– Same name and data type
● To refer to an element, specify:
– Array name
– Position number in square brackets ([])
● Format:
Defining Arrays
–Name
–Data Type of array
–Number of elements
–Examples:
● Character arrays
It is equivalent to
● Introduction to string
– Declaration
– Initialization
● Reading and writing strings
– functions of the standard input/output library (stdio.h)
● Processing of strings.
– String Manipulation Functions from the String Handling Library
● Comparing strings
– Determining the length of string
Introduction
● Use of C standard library functions for strings and characters:
– Easy string and character processing
– Programs can process characters, strings, lines of text, and blocks of memory
● These techniques are used to make
– Word processors
– Page layout software
– Typesetting programs
Fundamentals of characters
● Characters
– Building blocks of programs
● Every program is a sequence of meaningfully grouped characters
– Character constant
● An int value represented as a character in single quotes
● 'z' represents the integer value of z (122 ASCII value).
BIBLIOGRAPHY