Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

C Programming3

Download as pdf or txt
Download as pdf or txt
You are on page 1of 21

rade-:

else

ade 'c''.
3.

gole 'B:

3.

tolal = roo[o]+-
roasIJ+mads1;
3.
s . cathe ice oot O facn; ox
Dala
om.Accsible Pavate;
chs Notoscic,on able and Rivetclage
di0;
sbloy var 3
cote() inbut void
-fivate:
date class
Ex>
Jemction, mevbey 3;
dat merbe
unction; member Putlic:
Aivate.:
nme Clags Clags Synda:
3.
0;
bspby ob
qobondl
tt Cat
)
p-o23

Mexe con Cuss


More,
ncons
On cbet.
Jar automati intinlsntn
he Congtuctr is
teongs
the to. bu Con
dstnauished
Jonctons bt tovng the Bome. em
decoye. ond
tom oll atther member
nonc, as the cags i
clasan, ox ccbe dolre
del1ne hn caaide them tthimCometuco
The st thc cos an
md
the comsxcto
Conetcty Juncion inci
Rublc:
USCTOTe0;
senoe i:
UB26rome 0// Congtoctor delnmcd cude the
clazs /l code.
No etrn tybe is wsed or constrctrs. he caNetu
is colled otorataay by the y5ten.
Thaclae, a
alto inyoBed chn Joo os
aCags age Crazted. tomfrory objck.c
A dejaelt Congtrcy is a consecdoy tet dog rat
tae on cogum ds.
a clas tos a Corstucder coith oBgumen hot
Consstcdoy oill be vsed ohan on bytto that tte
Exomble
closs dotef
int month, day, yeot )

dael)
doy =1; henh-1: yeoy= 1999;
3
e(ndx) on doy is sheujed.
2
doy=x; month=1; yer= 999 ';
date (it , inty, int z) //dey mqh yor
doy= ; manth=y; yer-23
3

Destbacts- A destuctr is memte Jenckin hut


js colled audematcolhy eten on dbyest
js des sroyes. Adessactr aleo thos the Some Tome os
the clas tut coth a lde ( bee the casone
synt Joy the destchy in ct is:
he gereral
cles wserromc :

USCONOmc);
Eombe: coss sting i
Aivote:
Prblic :
ICaqStucor.
nt lengh =stdan ;
3tr= neo chot (Jngth +1);
Shoy (st,8);

sting ()
ldstcta
The Gonst Reya- AAconstot is om entity
cohte yake dos mt ctonge
dot ng the execulen a pogom. This às cs eh!
Temom he Some Ín a frogWm.
The keyud const con e odded to
on cbjeo to note tet the declra
ath a-thon o obiccta cnsent
vatdabdle,
3;
diglay: :(nte,int bd, ird hil;

oylint

00. dgly 4.86)


Zo-9-2023

frdin Oeshaing
Fncton dnding:-ohor ton cags cmd chjed
Ciented pogomning, orag
is used to delne a set o Joncdin hot aYe gven
At the same mome nd hxlam basically the Same.
ohexationg, bt sse. dJaot rgumeyt Jia.

yoid diplo 0;
Void dispoy (Cnst chu);
oid isplo (int one,jndt ta)
Void displäy oot Tuer):
Aamige:- The moin aoondoge ol uaing nctin
ONbaing.
"Eliminates the yse c Wyesat demeon momc8 r
he omc cpatn.
Helps to undessdand ond debug cone eagily.
Maindoing Code in eg.
Ove loamg ah yovicas cao tys he combiler
diztnguish botien
oedoded Junctisong aih he. some Turmbey c ogemnt
ozided, oidd heix tye is diyeed.
Bt lncian Cesbadmg. he ogommes lide js
imbiled, aa ite nce it recS the nende
t ymcden Tomed to anemed.
int 2quore (nt
oat sque|oat);
kle sgmef doubd

Ovslintonisqure
ng (it);
a84= q0ac(a).

ercin
ovsboirg
unctog coith heSome Torne wshidh dije ony
he tyo o agements ond Torba c rgumendy.
The overloairg medonigm is oebtobe cony Gitin

keosnes argmata: -
arguntnt e b Yalue, re alkd oncton
1oviably he sme ttes as the
arends Cnd the coi the agumer s Nalue 0nto t.
fasgorngy releomcs lo ncig:- Arelexrce aidles on
oiog.
ome ron chyae. by JPx the mat inorard
mo'n()

yebn tum);
Yatd maln ()

3
Trne. Jencn- malemgdaon hidng con eat
yein
he dale n acijecs.
ol the cslyo he mcop. ause the }omt code
to te excaded.
n rine uncton is tn jut ik a nom

-Ghas

ncl o de<cooh
clhss codde stngt>
ncla
nt Tum,j.

stochs(te, ")

Vaid
feasorn
soy(coxc)
etes )s'omendl
cut<
3. Poamdd jg"ettkColeg
3
-,l=, >, t= Com ho
verloaded to gine aoditional choxtiong or wsey - denal
*yes, 89h o3 chæs, heator obading am te dne

pogom beo)
he unoy chesag, uch as the
JNAENet 4H) and deament obaators(--), con be oyecan
he fegom wl te ed to coWat a stmg
with
wth om yaotocd
clsatertt.
SmY Chedoa; - Binay ohcxtors con aso be
orotos. Bao4 operabg wk th to oonds.
n an cedoatd binay chxotoxs
mction ahe
tunctin a, erg the aigument.
mcade Conio.h
'mcudez 9tringt
closs con vetr
Pivode:
Choy st [8];
Pubic :
3

(r)t

55
chscx ()
Convexte SI=
Convet s2= Weloomc?;
=

Conyeste S3
nt

Cot "+tSi)
Stsplat03.
- S2'

S2- dispby0S
S3-rpb)- SI++',
Inheagttance.
Single Snheacilnce:- Laming om ie-oietd
cance tginriy
caes Jn dhject
js ononey bosegal yatuçe. called inthedtonce.
F cankle:- Jet us congidex afogomivg hich coe
dealng coith þeoble, emboyd Jn an

cleyt, etc.
* Nome
Enp. IJ
Sabuy satae

Engyes
Secyetat
Parvgey
Chys Enbbyee and its sabclagses

chyses rom
Desiyed Clays i Dei yaften con hee
Bsge cla and

ath onaw Yaon the dexved cas to the ooe


cass as ow myee:
Erploy te

Monger I/pesived class

For:- Mbrnge dived trom embloye.


Meabars:-cass, mntes on, qazg e
Hceking hase. Cas
n cons hehe
membo nctong con cs hes
buble chjects, o
mers are iate te mrbes re
he the clas momg ay y
outde
Accssible Jo7n fcesblk
Cn clag Class
Clar.
Ye Yes Yes
Yes
Frotecl Yes
Yeg
Riyak Yes
Qm
existng cbe Then the mew dexived cozs Jz
Scbclay on the eriastg, chs js cale! bage celledo
nd its Said thot he ca.
subchgg (ox deave cop) inhnb
om the base clas
heitnce m tate pbre. in ma
SngeSheirnce:- hen a scbclass
om ee one nhitmce
e class it is knoon
X

Sab Clayg

irge Ihteeiknce
2 Madiple
rniegidance: -when asbeay inheilaee
rom multiþle se cla_ss, +
3. Hiaoha) Orteasae:- When mny obclass nbot
n a singde nse chs,
it is Xhoon as tiesacionl inhoidam.

X
Sub
cases
Hieraydigal Srhedanie
4 Meldiv ohince The tnive lre t
this yeom Jhoitanceinheitmee
Jyom a class tet iself cshen a ubclsgi rht
Jhits om ornYte
Pose cass
4-Seb Clay
Bose clas8 Z

MalA leye) rhgitmce.


6 Hytide rtionce:- when a
zorbolas inheits
ond all it tse claes jtthet om a
now
29- Se-2:23
+ ncude <insdcom "h>
# ncalde<conbh>

fuyte:
Chos me. [26]
int olno,
Cho
gm;
vaid disba ();
yold qemyo();

icde
chas cose_Tome[25];
int semesex;
chor qxle[3];
yd gdinloto i
yold dapog);
Ch skudend schabsti: public þen-bo, bublic
aonnie

Vaid gei0;.
Caut ee"mNome:"
Cn >>rome;
Þn>> oln0:

3 on>>gn;
Yod pson. cua::
Cocde< romee 1 .

yoid anuemics :tinjoc)


Cout nCause
CougseTome rome(BA/M BA/BCA ck):";
cm»Semessr;
Coute
Someserl i/2r3 7)";
tGradeLA 3, 8+, B-?):
3. on>>xodes

3
Couteu gade<< nd

aademics ::gie
Ch\n nant ecehed n f?

iis, dispyo;
ndonatecend;
Vold in)

"Plese

2o;

You might also like