You are on page 1of 7

DiGITAL AssEsSMENT - (THEOPy)

OBJECT ORIENIED PROGPA MMIN


AAME3-ADhanush sai
9.3 BcAO126

Fxplain the foioui texmg Loi th -tine

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

poiate vatiable -that not


might have
acceysfble -he clans , onsulng levet
abclhac lion and sor wty
(e)Inbetane
Lnhes?tanie mechas m oop that alloeas

les (suke tass ) or deed clas) însett opertis


and behaviaa s pon anothe clas (supaclass ot base
olas). or eNample, a Brd class fnhetit
atiibutes and methocy moi e

Anmal' class.

allowS e lases to
Pelymorplin
be tieated as a Commn base e las. This

enables
fleítktty ufng yfuent alases

înt enchangeaby for fnstans ce a


shape u claes
might
have method ealoulale aea and bo-th
frc' and " Roctange' clas Can implement
me thod fently basod en -hetr spe cific shapes
3
Yoturn'03
stdendi c<sume< z'Sum Std.Cout
(tem<znr2); wile y
t2 term
torm ter* Sumtz
do
>>nj cinStd::
ni; of lue vathe Entea :out
ce Std
=I,telm=3; Sum n, nt
an0 int
iesteam> fncluo
:34
Inpt Sum
5n
|+34
5'
th foltauing the um of
2
usfing
while. do Seies
th ffnd
Prgam White Q.
Sum -o
-to C+t n a
40 1eact numbetn and
3- Wite poogam
che ck uhethea d s a prossent
and
diqtt number Dut
-the pottlon
the
the numbe
of d n
o:75664
fnput
d :5
Output i 5 is present
at the positíon 4 fsom deft

Input n7566 9

Out put : is not pregent


fncludo eiostream>
tnt main ()

int u,d . positin z0;


cout <efnte the nmbei

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

<'position <*.pom loft o ght ";

not present in the number


Cout~2 dee' s
iqinal.no <". ;

4- Sumeize the syrtatie rules of the feeutg oop


statarents also n enampk progan for each
For Jeop
Synta:
fer (nitfalizatton i contion updat )
I| code to be nep eated
tnitiatotton : xecuted Once at -the
begoóng
condition ; bofore each iteratlon
checked
the loop enlsts
itela tioo
erpdabs iE re ate ofte each
Evample?
1ncudo <i0str oam>
tusng namepato stdi
Gnt main)

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

Ileode -to be 1eprated

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);

You might also like