Professional Documents
Culture Documents
enample
ca) obfec t :
An objeet tongible instante
s a
iento d pogiamning (oop) for enampb, if
«bject - Cal ike Toyata
a class, a cpecifie
would an obfect ot the
clas
(bT classes i
classes buepoints
ase templates for
define the pooperties (attibutes ) and
chfeets - They clas wu
behalvouas (metkods)that obects of the
have For frstance clas naf have
f ke color" and 'nodel" alng eith metarele
o tti bu ts
fKe ergino.
cc) Data Eneapsulaton!
Data enta fsulation bundng of data and
-thal
data ittin
the
rethedL that opeate
a clas. It he ps
a single nit. ypicag -the data.
-lo
ad oentaol lang
ganzng a
wtt Ppivate atoibules
Ar ntea ct witt a tlbeutas
mothod -to those
and publie
(dDrformafion Mng
s the poinciple otctng
Infamat Mng
to tevtain datails of olýect and ony
Lwhat for instante, o cla
eposng ne Ce
Anmal' class.
allowS e lases to
Pelymorplin
be tieated as a Commn base e las. This
enables
fleítktty ufng yfuent alases
Input n7566 9
cin 7u;
Cout fntee the numbel of d:';
cn >7 d;
nt oi aqual. yo 4;
while ( 70)
Po,ition -t;
if (digit =-d)
Cout ed " Present is the
cout z i ;
Syntax ;
tohile CCondition)
I|Code 4o be ne pralod
iteration
(ondtion: checkad bo,fone eath
1tfatse,the loop eniss
nelude o iostreom>
name space std,
t main ()
wkle (icrs)
Cout it" ;
Do-kle dep:
do
tile ccondion ):
onee;
Code block - Ex ecutod at deast
condion ? checked aftes itenatí on
i4 false, the loop eásts
intlude oiosticam
tusng namespaced std;
frt maint)
do
Cout ezie
osle cie=5);