Computer Programing Lab PDF
Computer Programing Lab PDF
display();
return @3.—
Preogevirn 44; Paegtam
Algorithm +
=m: bee Farckien
Stop £: Stone an ae .
Siep2= Dedasye Cars frinten with ante ™
Shp Bi tee Areers Epes pice, «
SRE: Prarivate —¢ cimin prrivste
Wp ond;
Within poli peda
w= Jato
doth fore
PSE Biden sr volux yp tergin 5 barasitns 24 _
Skep 6 ie
O Arse ;
Caeahe okies pont ;
Set lounte pointer *P ;
p= Spat;
Shep $- Coad furdion be pict autpur Stabemenh
pursnose
Pos ditplanc); Flaschat
Sp %- Stop q
gx
Class Poinkes,
A 4“
a pias d
deb;
@ Pointer port,
S Joiner *p ;
b= pa;
© ptr sroa € 4160) 31)
" Lanapi on
pro ditplog Y
@ mtr te =
Butpt = gensCC
Bargam:s9 = Pangan rn om antpine
Aesevinn a qrembre Finction
eps dade ember aq
Fed: Deebar Clay peinber wit
Ship 3: Sob Rees epeigier
eet Pestveabe:
Jab pov
ores Bot sp
PR Wy = sok
teed ~ iny
PS Mintare obyee caitn prinder -
Lp Gintay PAplayc
SEPT COL Beatin op dsptoy Oudpur
Skpt+ sup
wn)
Sane
@ Cay psorer
© neivay a}
Pardic :
this a P =P,
Ws &: i
thigo Fed j
(0) poder pry
pidrer 2;
Pp Saplayes
® Spur are value df p
= d= de eh
fay
de k= 009
+ Langth =
b,program 5 ; aie
OND Wed
program on virtual function.
virtul functionpp > .. 2 ,
1 #includeciostream> ~ oe
2 using namespace std;
3 class Laser t
Ss
s public:
6 virtual void display(){
7 cout<<"Light Amplification By Stimulated Emission Of Radiation\n";
8
9 }
10
i};
12 class Intensity: public Laser
a3 {
14 public:
15 void display(){
16 cout<<"Energy concentrated in a small region\n";
17 2
8 Oe
19 int main()
20 5U
21 Laser light,"p;
22 Intensity light1;
23 plight;
24 light .display();
25 Light1.display();
26 p->display(); Diet
27 return @3Porgaom 50; fusgaem on vive!
Foput Saromeor 2
ee ite aye)
Fobensity tights;
Pe hugnyy,
AR te Cig Oo
@ Seputs
Lyn Amphbicaion by Mmatoed Fenisys
°F PactiaHon ‘
Frgugy (Nr en rated jROrmatll region
Enorgy lntabrabed [A asm region
anchor +
Algor nem
Skpt Sahm ber aed mombet Funchoy
Dep2) Dedtame Clas loser with data mem
M8: Gay Virtuo Fanci
Set Taper stotement Ne cotn ea
Hep St Derase derived clay sorensty Be
and membe funchon:
Sep 6 Inpad Starerment.
Sept? Goete On bye with epoolntese
SEPT tau Yusmin fo outpat ciroment
Shep 9:
Steptar sop - plows cha
Dow Run. Cu
wetane Ulery Lek
© seu Mimi ena
Ca Lager “ha oe i
Toph stuberneat L tt Ureraad funckon
Clon Savers ity ¢ pablo Laer _
{arpa Satermene
Z
J decor dedverf Clary
frven ty bPebue Laver
L A‘> Program 51
en © pure_virtuatepp > ..
1 #includeciostream>
2 using namespace std;
3 class Tree
Cet
2 public:
6 virtual void t1()a
Pr os
8 class plants : public Tree
Baad
ae public:
a void t1(){
22 cout<<"Lavender plant\n";
13 }
1
15 class flowers : public Tree
16 \
7 public:
18 void t1(){
19 cout<<"Sunflower\
2 } ‘:
ma oh :
22 int main()
234
24 plants p1;
25 flowers £1;
26 #1.11()3
7 p1.t1()5
28 return @;
29.
Output:
Program on pure Virtual function,S99 52 Ged Pave virhuat famaion vithie BAF
Beep Dectare Aeuived clay peak
nd membuy furshin :
5: J
BPS Ca Lonation wich rave rue 04 'sorme tae
i pare clos ard shpub Stupemment wih lets home
BEREORMMUAeHdias, puny of On TH 7
ond Memb fan ch
pH hj
Same a4
Sep 8 Coreare et Pian ps
a Powe &;
Stes) Call Farchiins fo Qurpur the storernert -
Sep tos Sop.
Day Pun
© Soot
(QQ) don tree
(@) Virtwat weld tO20,
Clary plank + public Tree
void fit)
® dass Hover t pubhe Tree
void 42()
plant pty
Flow pl;
Fino),
Pao),
) berpur s Santioort
Loved plank
©
aReneRes yam a9: Racogram on class tempdole -
Aloriine
Seet™ Sten ond
Sede Pretae clay eympe usin deta memer
QI Dibine tempt, — Thpe ae 1p no meIgor”
Spe apse vabeins om
See even,
Det Cocean an obpet
Ste? aN fntin display the Output -
SP Outpar
Ste! Sop
bay Re
O Stuer
Clos Sample
Type ob
(A) ener He veleUNs = 16 5 Enter treveley
200 FT By2
4 Sampe.