0% found this document useful (0 votes)
4 views

Oops Set 3

Uploaded by

gangster2003123
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Oops Set 3

Uploaded by

gangster2003123
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

AAsigmmemt-I

0ons winct
Sot 3
Sectiond
Otlaim dafauasgumendg in lumctions Take Sitable
Code erampas
Dalolt aegumends in lancicr, alou you to hoct8

Caller does not oui de a vale (oethosa. paomtens,


the daloud values axo used This featue Con
nahe Howr Henc long mo Mloai bla ond
Qasi 4o use

#imclude < iestacam>

Mes sumctiom uith daoult agimend


displag CChor c

Coui<e endl

\aùmC)
Cout ce No 0rgunand pased 3
dislag(s
Cot <
display'),
Coutee oth argumands po

disey cs5)3
3
No orgment þased
posed
Fisst
zgumond ossad

Both oenumends posed $$$$


\ Find the values a,b &c Aomie foelcuig Code
Void mainC)
ind -2,b:S,
oa
C'y

C= --b*++aS
tt
Cout L a <ebLLC
Show all the itormediate asgcalclato d bgyou oten
lach tatement is (xocutad

dal a 6
C =264
no di y the data mombehy
9q- Cana Const memhen hunction
why onwhy not 2
the closs

No, a cost memher hunciicm (annot modit


ho data memh0rs tho clo Thiy is hs Case

the const heyword im the funcliom deelatato


ensues tha the humctien dos not altesthe
Stade on uhich it is collod
the Obyect

Bocause when you declaea mem heshnctio,


s const ,you a piomising thot s sumciy
functioy
il not chorge vasicbles the
the cls
O (om a nested closs acceyr e pavae memNs (t

Cnelosing closs? Exþlaim wtn the help oa codo exahir

jes,a nosto d closCon access the pavade momhers

This is bocause the restod class


Hs enclo ina clo

is Consi desed a nember the nlosirg


e

Clas nd remhers od a clos con accevs


Cach cthes's ivatomombes

tinclude

tuhimg
<iostacam>

na mapace std ;
Rivate :
ind paivate Vaa,

Outel ind val) aivahkaaC val)i 3

Voblico

Void display Coutas & otes)


Cout ee Rsivate yakiable Outea clos "
3
33
33
jont mamC)
Oude owtor(1o)3
Quto Imea ines
imer display Couter3
BG- whatisa pomen inCtt 2 Tahe Butable
v Àd

(ede exem hles to tsale.


4oat The pointer d ona tue ccnmo Stote the adds
amcthertyreHow ewn ib hoU lwont tode be
them uou howe to we the vcd pointen Co aeneni
bointen void pedea con hold the ddds
d

q ony tree vaiablIt is wsed whemthe


exact tyhe o vosioble i's eithen n anon s chamae
mdea picai (iacuom stonceg

Fg
Hinclude ciosteamh>
# jnclucle<conie
h >

|mt maiml)
ceaaca)3
Void t
a=t
ind

Rat bla53

Cowse\nb 22
galic)3

Ouput

b=175
46: whad is a desgtucto inctt 4, Taba a Buitable (odoeYamale

to iasade:
A distaudo isa nember hunchiom havimg the
ame ame as that ot ConstAuct oC which is

Bume ag that clos) bud is is pace ded b


a tildo (n)Symibol ond is ex0cted atoralically

whem
obgect ga clos is dgtsoyed
m A destaucto
4 ho
dlsaody
(aaated by the constuds

Hjmude< conoh>
Qas counter

Public
CountenCint i)
(ot <e\n constouct a o obect ithid)

3
nCouel)
i (ot<c "lhcbect with 1dce idee"destaoe'?
imoiml)
Count (Ia)3
(oumta CaCa)3
Countel3(3)
Cout<1nEnd of mam
|Consteudon of obect itid
wthd 1 wns

lostuct 1d a
Obged luth
coa

End oh maim

Obgect uwth Id= 3 des lacyed


Obyect uuth 1dd destaoyed
cbect bith id=l destaoed

Secticn- B
366+ Exhlaim the mamipulatos incH:

Qv) Shawpos ()Bhowpoint


(utield: Thsig a bitmash tujod te
DiObst ad
Contaal Aho

*includ<iomanip>
usina momesbac.o &td

(ow ce twllo) c

3
Output

Right
Imdesnal
i) iosg oat ficld This bitmash (ondaols the floating
hotation I (onhinas Itwo agt

Car tincludecios lso.m


Aimedeeiomaip> 1234s6o00
lsingna meshace gtdg |:234 S60 e to2

douele mm= 123456


Cot ca Sciendiic ec nmc endl

|) Shewbasei This moniul ao Shouus the base of numealc


volus(en? ox loi hoxadscimal ,ojoncctal)
la:iQudnio theam>
H inceudecioma
up

nt
Ox 66
man()
0377

3
(Gv)Showos: This manipulato Shous the petieSig()
eai tindudoeiaslacum>
H imdoziomoip>
Wsing nomaszuce sld3
lod mainU

Cot

3
poThis momblaon ensuss tho' the decimal
oind is alungy shoun (on loatio ont
nlmbes,eheni he aclonul
ped
CasHimludo iotooms
loor00O
Sing omaspace std
ind mm()
dohlomum loo03
lolee Showpei ce nmez lndy

3
(ode
hume m ond n wte
H jncludo< iastaeom >

stymomespece Stel'
1ame(intm)
i Cnumb i==0)

1tnan()
mo
lowecetetuo

but
lout cc"pime mor btw 4nez"a "enoses),
)

getch()5
8
3
(9

ipw
(opy (onstuto t6
8a4 usrte aC tt ctom Lsing a

(ode
wsute ouput oryo
d

&tds
Usia hamepacs

Chat hame LSo]3


lotmahs
Pualic
(083
tudent
Studend(ind , const chaatn,Moat m)

3
8iuden (Const Student&s)

8tacynome , memi)

2
Voic
dispey

Cout ee
Hoshyo
333

Chas nomeLso];

Cout ee Et acl0 hembes


Cin lno
Cout eeEnta home'e
Cin igmone)3
Cin atine (rome,So)',

Cin s>marhy
tudend studentl(sno, nome maag)

Studendl dipay3

3
Output

En nome Johm Doe

Entes masg & 85-5


Belailsof
Studenl.

Nomo % John
D2
Hahs'o 8SS
Ddols Student2 (cdicd jton student):
Roll Nos
\ol
Namas ShnDoe

You might also like