You are on page 1of 6

PAGE NO

Paactical No. 8
Aim P2092am toImplement Eiend funrion

Kesdu zces used

lame of Resoue Specifcation

LCompute ry THem uOhip7OLeasoY G


booad Speications RAM HoD 4D GB

SoPtOde wind ouoS to LIN OX

3 Any Ohex RUDUE Tuaboe ct W210h


Uled 3.0

Reswt
e able Lo u0de poq2am to implenmen
iehd uhciion
Poatica Relaled oueTHions
Can membe FuhcHon s of one class be
foiend punctions of anohey class?

a) YesS

2 A untion Can be deta 2ed dpien


maximum Only ih hoo classes
PAGE

b folse
hefolloainq uel not
LOL no
3 alhich of
arrecthe iend unton?

p2otecled membe can be


b) Piyade ahd
gCCes Sed_Qny udhPT?

Iathere doe KeyLooad 'Biendthouwd be


placed

a) funcibn decdaoalioh

EXerase
alieg Ctt paDqadm to U0aphe Vole)_
o Hoo Vaaobles usibq fiend Fuhcion

tinclude Cioeam.hy
USing nameJpace Jd
CssSwap
intLempgb
publiC
Swap u n a in b)_

this- g=g
Hhis>b=b

fien Noid sOap CSuDapf)


PAGE N
OATE

3
Void Swap (Swapf s)

cout < n Before Swapping"ola<e" "_


<Sb
Stkamp =S a
SI.q Sb
SI b S1 femp
Cout < n Afle Swappinq <SI.ak<
<S1b

Lh majn

/peclqre and thialize the Swap objet


SuOapSG6)_
Suoap

lteq E p2oqam to deine a dasf


biahcehavihqdatamembeN 9J mekei
bisplay he addiionO o difah celobje-
C3 OSing Siehd htion

Hincludeio J am.h
UJingname spa c e d
class DP

Publi
float distm
publit
b C) bitahe
bianee Ona-eed
Lhnghe

COd<<'\n\t
Ente

-
Cin > dinm
d d2
totaldiit CDM
piehd aid
bM d2
Void totalditt CDdL
3 da ditm
ditm
float dit = dl
'\nTOtal bLtah Ce h mgeM=>
COt
_ditt
3
in main ( )

DM d2
ialdit Cdi, da)

3 Comb1Rk he table '


PAGE No
DATE

Proqoam cbdk Ue 4utE 6utpu


#includeiosream-h
classA
A q0
Int a
publi
AO a 0
Biend Vbid thDuoA CAS)

Void dhDueA (A4 2){


3
Void maun
O

Aa
ShouD A(a)

Hinclude iosmeamh 20
lgssBoX gR USing
pho iehs uhtton
double width Fo pintwidh
public ahd muHplio
Piend voi pintwidh C80X box )z h e ordth
Void sahuoioth doublo ohd ) V.ouue by
Some A0t
wiqh Ordj Hal oLutpu
3
Vol pintuwrdh ( Box box)
DATE

box. oidh box. oidth 2


cout <"IAidth of box
<< endd
box wid Hh
3
Vold main (

BoX boX
lo0xJe lid h C1b.0)
pintididth CboxL

You might also like