Six Week Training Presentation On C++ Programming From
Six Week Training Presentation On C++ Programming From
PRESENTATION
ON
C++ PROGRAMMING
FROM
ABOUT HCL
• HCL Corporation (originally Hindustan Computers Limited), also
known as HCL Enterprise, is one of India's largest electronics,
computingand information technology company
• . Based in Noida, near Delhi, the company comprises two publicly
listed Indian companies, HCL Technologies and HCL Infosystems.
• HCL was founded in 1976 by Shiv Nadar, Arjun Malhotra,
Subhash Arora, Ajai Chowdhry, DS Puri, & Yogesh Vaidya.
• HCL was focused on addressing the IT hardware market in India
for the first two decades of its existence with some sporadic
activity in the global market.
• .6weeks training from HCL- CAREER DEVELOPMENT CENTER 17-
sec CHANDIAGARH in c++ programming landuage.
About C++
• C++ is superset of c. C++ is built on
C because of C’s suitability to system
programming , its widespread
availability & its close ties with the
UNIEX operating system.
• C++ was originally called “C with
CLASSES”.
ORIGIN of C++
• C++ is an expanded version of C. C was developed by
DENNIS RITCHIE at BELL lab & was 1st put in use in 1972.
• BJARNE STROUSTROP developed C++ in 1983 at AT & T Bell
labs, New Jersey, USA. It was 1st object oriented language
& also strong supporter of C. C++ was initially designed to
manage very large programs.
• It was named first C with CLASSES . Later in 1983 the name
was changed to C++. In the name “C++” “++” means it is
an advanced & incremented version of C.
• C++ has been revised twice, 1st time in 1985 & then in
1989.
Simula 67 C language
(1967) (1972)
C++
(OOP’s):
Message
Class OOP’s passing &
reusability
h is
p
In
mic or
h
a ym m
Dyn ing
er
l
Po
it
d
Bin
a nc
e
OBJECT & CLASSES:
• Object are made up of :- Data
members
Outside
Member
World
function
Member of Data
object1 function
Object 3
Data Abstraction:- means representing essential
features without including background details or explanation.
Class use the concept of abstraction & are defined as a list of
abstract data & function to operate on these data.
Encapsulation :- wrapping up (or binding) of data &
function (that operate on the data) into a single unit (called
class). The data is not accessible to outside of class. Only
function which are inside the class can access the data.
Data Hiding :- access to private part of an object is
restricted in the sense that functions of the object can only
access the data & can’t be altered by external changes.
Relationship b/w encapsulation & abstraction:-
2. Multiple inheritance :-
Base Base Base
class 1 class 2 class 3
Derived
class
3. Multi-level inheritanceBase
:- class
Intermediate
class
Derived class
Base class
Intermediate 2
class
Derived class
POLYMORPHISM
Polymorphism means one name & many
duties. The ability of one thing to make
(poly) distinct forms (morphism).
The property by which same message is
sent to object of different classes & the
objects behave differently.
Compute
Area( )
Data types
if-
else Simple
Else -if forwa
-if Neste rd backwa
d-if rd
Functions
• Function is a self-contained block of
code that performs a particular task.
Function types
Library functions
User-defined
(not required to be
function(develope
written by user)
d by user.
Examples:-
Example main()
sqrt,cos,sin etc
10 20 Formal
parameters
x y
Char
• The complier automatically string_name
supplies a null character(‘\0’)
at the end of string. [size];
String Functions
• Standard library’s string handling functions, which contains external
declarations of string functions. #include
• Strlen() function:-counts & returns the <string.h>
number of characters in a string.
The null character ‘\0’ is not counted.
Form is where ‘n’ is integer variable
n=
• Strepy() function:- used to copy one string to another.
strlen(string);
form is
strepy(string1,str
• Stremp() function:-compares two strings & returns 0 if they are equal. It
returns a negative numbering2);
if the 1st string is alphabetically less than the
2nd string or positive number if string is greater than the 2nd string.
form is
• Strrev() function :- used to reverse a string. Form is
• Strupr() function:-Stremp(string1,
used to convert a string to uppercase.
Form is string2);
strrev(string)
• Strlwr() function:- used to covert a string to lowercase. ;
form is
strupr(string)
;
strlwr(string)
;
Structure
• Structure is hetergeneous collection of related fields. Fields are
called structure members or structure elements. Every field has
different type-specifier (data-type).
• General format of structure definition is:-
struct name Keyword also
called tag
{
struct
struc student
datatype
member1; t
{
datatype
int roll;
member2;
char name[20]
datatype
int age
member3;
int marks
……
};
……
datatype member-
n;
};
Declaring Variable of
Structure Type
Once a structure is define, declare variable (s)
of that type.
Synatx:- Sname var-1,var-2,
…………..var-n;
Example:-
Struct student
{
Int roll;
Char name
[20]; Declare s1 & s2 as
Int age; structure variable
Int marks; representing two
} students
S1,s2;
Initializing Structure
• Like simple variable & arrays
structure variables are also be
initialized at declaration time.
Struct student
{ Structure is initialized . Values
Int roll; are enclosed within curly
Char name [20]; braces . values assigned to the
Int age; members of the structure in
Int marks; order of their apperance.1st
}; value is assigned 2 1st field…&
Student s1={100, “amit”, so on..
18,92};
Union is a variable that declares set of multiple
variables ( called members or elements having
different data-types)sharing the same memory
area. Compiler allocates sufficient memory to
hold the largest variable of union
syntax:
Class <name>
{
Private: User defined name of the class
variable
declarations;
functions
declaration; Visibility mode
public:
variable
declaration;
function
declarations;
};
Accessing Class Members
• Class members that are declared to be public can be
accessed from outside . Access them using following
syntax:-
@. Object-name . Member-name;
Class sample
@. Object-name . Function-name (actual-arguments);
{
Int a,b;
Public:
int c;
void main();
};
Main()
{
Sample x;
x.c =4; //accessing the data
member
x.a=4;
x.sum(); //accessing member
function
…
Defining Member Function
in Class
Member function may be defined in two places:
Rn =0;
Name=“ “;
}
~student (); //destructor defined
};
Inheritance
• Inheritance is a process of creating new classes from
the existing ones i.e. base class to derived class.
• Protected derivation:-
Class b Not Class d: private b
Private inheritable Private
Protected Protected
Public Public
(base class) (derived class)
Public derivation:-
Class b Not Class d: private b
Private inheritable Private
Protected Protected
Public Public
(base class) (derived class)
Input Input
program
device stream
output streams:-
Output output
program
device stream
STREAMS
ios
iostream
Stream Type
Object Address of Size of variable in bytes
casting
variable
Write ()
outfile . write((char*) & variable , sizeof(variable));
Airlines reservation
Passenger Flight
detail detail
TURBO C++ software.
Passengers related info..
Flight related info..
Cancellation required in case by passenger.
Help if so requires my passenger
Queries regarding reservation .
Flight
Info.
Day of flight
Fares
Boarding
Fight code
point
PASSANGER
INFO.
PIN CODE
PERSON NAME
AGE
CITY
COLONY
P.O.
Enter the name of passenger.
Flight code.
Enter passenger name who did the
reservation.
Flight code number.
Help direction
WORK LOAD IS REDUCE.
MANITANCE OF DATA BECOMES EASILY.
TIME SAVING & FASTER.
rk b y : -
a m w o
Te C h e e
e l e e n
•Lov
ma K u m a r
n e s h
•Di m a r
i t K u
•Roh rg
h il g a
•Sa BHAGAT ENGG
(DESH E ) n gg .
G E
COLLE er Science
omp ut
C e nt RH
a r t m DG A
Dep I G O B IN
Thanks a lot….