Inheritance, Interface, Abstract Class
Inheritance, Interface, Abstract Class
Keubaol1y.
amettwe viouxe: f Cloh Imels |xopevhrs of
Ovol ie(lons. Thtnaljbuvto46 0t Br uOlt OM to wnitalu
nhett Ope q ofA. Ths 1 Co11edtxmsthnwe.
OCfcYv ttorm5
Sinole Ivshcxttrte. whm abub tlans 1mneyil fom
HiexaxItal innettent
oMy 1a clags.lt 5 Called 61nale lnvnevlemr C
6ub tta5 5,
,
huv tto6 MUt 1tWetinve ittnte:1(omt,thwt mohy vi of mvo1
Bupn Nos;
whm a Guv-tóbs nne vtle, fyo w (lD4t 1n on It-
A
A
6unylons 0k a tla46 '0bjtE
next
AbpMcnhos 0 nneyltaml
Itwlenent Xt useab1luof (loufes
¥ t ato s to wwllewoe nt 0
Abe momtiF lwam
hexahous a
&hMentendb kmuosd:
th1s Ktmooy x wat e H dloesnot auo uo ettnhon of memb
1c deYwrdtlass
hast (la45 by
t Y6 met Vods of ts owv (la4 6,
dyntan
class deYweeltla45 vmamt ettenods xo tetteed
pnbe (la45 of mtmbers Of hast
(las5 hy nen- dex wtod rlons
V1Sibilt m ocde
hu m 'w hrs m e t h od.
ttalo0h 0Memhon of mo
ow bexs ME
Votd entty):lnput Kn2
dceo t lass Voe h o ) d1elp1y d2
P
7
Defne supesllass no and buntlas balayu
lwbovt jana-uhl. *;
to tnd hotal bala
(last namt :Imfo.
IN: nomt nt Sala
Sala VOId (ttloE)
MF
NO1d ActpE) "); 4op1"an d6alai
50pl ( Ente nawme
Cl Lh namt bnlary
Nallouoan te
to tal
MP Notcl to ute to (olmlete A11ouoammt S0pln nam : "ana t )
btbe ALe
Calmtat 4 talalaxu wox |aNa.um1.
Ctan 5alaxn entcnds In fo.
Aole A10wanlt
Vo1e diplom t): Dk doun le FoFa1
Void (0 nlutt )
Aceeht L)
(6atn 2 o0o) (onstXntox lmneztame:yotChs 0f 1n vok1no
Constz toy 0 5u/2¥ {la55| a b t (lass
G1O mlt (1.0 to0.o)*6al; w i n fonst Yul(-o? of cexwettasy t l4no
fonstXuloy ivn ntsltenle
hm)tME
1 Y 1 Ob -itm olavnt)
oD. (ownpute1);
ov.d15plownl)j
fmhox |awa.u H1
d= d c
Styin na autnoY
votel fine
elounir | r e
(1YaYy(Sting ,**Yivgp
counle nb) (dk= s)
2. o0;
(d>5 LE dz =10)
el6e
utv0 = 3 .o0
el
5 00
Vo1Asol)
Mt eY Funthon
PexnnettY( . . ) oxawoete(12eo dounlt (almtatt )
Contut tor.
dounle (al ulott F 2* (0+) t a dounle (all = 2¥ (atb);
Vod snou t) - Xtwxn (all
NO1e 6nol)
Systrw. o Utt pmtin ( tgintt*+ong1n
en- Systean. 0nt 17Y1ntln( "Bead th:"+
MF dount 5oplv ( Pevimtt " o);
Axea .) = tAlnatt 0 ;
dounle n:
dounte axt a
b, douie ir
Axea (aounie o, clouole
amnle of (om hile
hme o oxpn16m
ME
Sní1a e oe Void n t data l)
Ctas namt: max4s.
Vo lznt data )
stan(e NnXlablts
tvtal, pev: AAnou 60pln( Namt MawMt) 5015 ( o
:Cxndt
Sopln ( 00"+dooxw); no:
95 A
Ct065 mayks CitEend .6mdem
6o&kk< 95
>Ho L 60
doun Ic ot, ey; StoiMCY 5( = mtwh tavnt(614
Votd Sea d dntnU)
ME 1nputdata);
+ot =
5(.netE1Do uwl);
Noid eacd data l)- tdtal mark 600
Void (ompute () Votd (om hute ()
Vot 6hoo data (:
peY= t t a (tot |500) 10o;
f (pex >- 85)
(la46 5hdent
Cmployee Data )
(t64 amt Gmployee odata.
nstanle NaX1anlrs |IN ewmbtode 0,
?mbtodt: imt; employee DataC)
on ay: douvlt
emptode = 0
Mtmt Y funthow
habu h a °
em10etodata t)
emptoyee datalint/, dounle cd) enpioyet Datal nt(, mt cdonolt h )
Void smt ()
wmptodt 0
(lans hme OveYhme
days no:of doys worl4tod estt yo.
Satt: 8ate| dom . Void hrvt )
Mtbty FuntHon
0pln " mhloyet Oata :"+ Pmprodlt)
0Nerhmt(. . . . ) 60pln (" 3ante |5an:" + nas1t1a
lonvne almatt-6a|) -tot5a
Iwmoxt lonl autl¥; CIab vMame: Vlnme
(Ia6 0tY hwat entndh tmploy Dat
In 91
Int nodavs;
nt
dounic &at; Plane (. . . )
Ovey hwnt tnt ,douolt d, imb no doys, doubit Y) Notd 6nov ()
6nlptxC cl); 02
n-noday
att- -.)
Votd fnd hadn 0)
dounlt almtatt-Sal) Vod find Axea ()
01th &A = ndays + ( Xatt) A VagiLGa\ONX Vod 6hoW)
Inl)oxt 1oNa.uh ;
(1an5 NMaMM (Axel. ettn td 9\ome
Void vo6a10) {
Yinr);
m2,2
(Ile(inl 1,Imt u1 ,imtot,tmy, )
5o b alla te-5a1());
SnbrY( , 1 )
2 ( W2
Xad u 0 . 0 A3ta:0.d
2 2
Vod find Radus) Abstxat (la66
XndnA t)
50pin (" Xadus "
doublt Xndn
v:
Spneye (do ublt y
nAns: Y»elius1 deunal.
MF: aeltne Y;
S1phty (donwlt );
avshal vod tobute Axea ); anstxatP VOd CowlputNotttnt ();
avnsta l F vocd (owm|nte olM we t) abtyatFvor (ow hmtt Ascat);
douwle oxtn
Vot: douvlt Volut
MF Axe1 ( dounlt, 9
Axt(. .) .
-
VOnmt
Sopl votwme: Nownmt)
22
30 ",1
chuYnxue else
Sopin Invald inhut");
Jefine avn abbtxatF hype Suþe? (la% 0bjett
sthne VaYlavle Clas Noluwm ectevads 0v]eu
douwlt :
doule h a n ,
Onet(douwle ddms) c oule Vrone
anstyattvoel(ont Voit)
abshyat Voi tloleyvo1()
clAS5MA
No1d s ho w l )
Voie how )
o a nne
Imo& jawa. uhl¥
InttxBat namth : 5ha|s KMA inica-la t 6hapts
ME:
xey?n5t a x a of doavltadca ();
oule (altAxeal):
Sna pe lmwn)pl ewevms Shate
Ctas5 5}phexe
5p
dounle Xadus
( doastç x)
admb 5 hhext
adimse X;
ME
Sbet (dounti *) doumlt
dounlt (alaxlat):
ne1gn
CLasb mlmott Implttn l55habes
MF dounlevMeignt,
thvnelt ( doutt Y dlmolt ): cou I 2acd;
edou (n1LA y tn t): dounlen)
Xaod=
I anstYatt(l445,Kmuood¥ n an IntcYtate
Anbt Yat1 manelaFoyy Aeyuord anett t1
t derlaYt tyalt OpHonal to del1oe
M od
(onve
Mtnt&- wmttm od Me neY-mtMod ta
6what 1 mtefate -7 Ho 141ntetate 1 ditCe
t a (ta5 havmtand fxrnt
towm (lans
xo (lC5.
ubtd to 1nthali2 nome and tt Mitd
OM 0f Ctass.
lntefate Class pexfoywm parhrvlaY
4 10 V1ual (onst A (labs tan h
that st þy¢stnlsa stan hateol ln Foa
qYoup of twtytes. no:0f ooie tls ond
Jhe enhYit iwmam Mas (onixut toY'of tk
tylr
be elato /mt th otdA5
tyl
An intcy-fatt Cannot 6) Fottouo i g finnt ho l hart ofn (tohs
e tntoavhatr d to
Deftvmthon. n d ovnout Nhen n =Iand n
19. Io.
objert and dorhnot
hNe ay
Conshgl to Y t moqntfinn ( 1tn)
t: o)
trvho
m a a o w (nl ) * 10 4 . 2)