We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 50
mnie
Siaeta fear ence aes, te (zener) sented
aera areaHaa, sere
oft, ereria titsae ured smaéia fen afee, Sere
(sraftres fase
%. oarere aria wiad areca Peer fee, aeons
(antaftres faster)
&. shart eeararg dgara cendt sracia en aifee, sere
ageaeit : 7757963230, 7397963230
Email : [email protected], Website : www.dnyandeepym.org
radia area, Heds-aret
aradig secs aise pe, ateds—atest
(oraftres / ameaftre / se antafire fete)
sradta wenfaencra fara a afdisa, aeds—atest
aqeneit : 7719810000
Email : [email protected], Website : www.dnyandeepcollege.orgINDEX
Sr. Pi
N 5; age
Ria ‘ame of practical No. | Date | Remark
1 |/mpelementation of Exchange value between |.
[two numbers, tig
2 |Implementation of binary search 6
3 {Implementation of class & object
4
Implementation of array of object.
Implementation of pointer of object
6 [Implementation of constructor and destructor | j {-
7 [Implementation of operator overloading se
8 [Implementation of Constructor overloading
9 [Implementation of Virtual function 4-18
10 | Implementation of type conversion
11 [Implementation of inheritance
12 |Implementation of to calculate area of circle
and triangle BI
13. |/mplementation of o calculate addition of first | > 2
Ja numbers in VB
14 [Implementation of Case statements in VB
15. |Create of webpage by using HTML.
16 Create table by using HTMLDayandeep English Medium School, Morvande-
(Science / Commerce y iT
é Department of Maths / Computer Science / LT, 2
ane: Phir: Sri) POLAT Sie: TOTES, gu sf a)
_EXPERTMENT No 24
7
\
Title -- Impelementation af EYChOnge value between es
100 numbers -
Ee fi Write progtarn 4n Ct thot exchange data
} Fea by value Sing Swap Sanction ie. vc daar
e Cintintyto interchange the given, +100 _seembAts,
&] Erter the prograrn and Merk pichet E/ecubis,
1___644he Come apthe Compe er. ___ at
i. —j obtain a bord copy 6 +h 4 1o_isting — 4
O5 well as output The. Cutput must list tre
| ___given numbes before 45 well as aster Swapping
Progam + Exchange the values of 160 pusnberS
#include bs |
NG 2D) 2
cout
#include
void swap(float &x, float ey)
{
float t=x;
void main()
i
elrser();
void swap(float &, float &);
float a,b;
cout<<"enter two numbers";
cin>>a>>b;
Output:
enter two numbers
6
9
a=6b=9
a=9b=6
®( Science / Commerce ) _
BS] Department of Maths / Computer Science / 1. T,
Fane: Rohit. Seni Aotdar std: TEE sign
p Dayandeep English Medium School, Morvande-Bor
Should print | _ the number 15 found “otherwise
: 7
—H Should print "the ny umber is not-found!”
= 8] Enter-the program and u Ker — |
— ton ofthe Same onthe Pa ay
- Cfobtain. o-barcl copy of the progmm _iGting |
019.108! oS OUR pe
oghamn: Bing rt} Sq cha eee
incwle< | nsieom hs __ i
Fine aL
Ciraere)y;
loot ole: -
“type the umber jn en
-
in >pafh;———_——_ og
a __
ut << ‘ype the No_youwan: Zz
tree THEN NO: 9 =Dnyandeep English Medium School, Morvande- ba
( Science / Commerce )
Department of Maths / Computer Science / 1. T.
ame: ROH Sunt. Potdar St ual IEE Sign:
oeee ey —
te ste) (evGnia} {=6)) a
cee = $$]
| ebe ia
Laide
Te (aca}==6)
Cout ce" the numbers. a+ position “ec (mid) 2c Nn
ae = : Fi
| cout ZU the number is notfaund ny
lgetch 0;
2
Ts
| Ou
(GE erin sae
[t5pe-the nO you “twoarrt $6 search
eee Se Um!
eld2
Program: Binary Search
finclude
finclude
void main()
clrsor();
float 10}. p;
inti, top, bot, mid;
cout<<"type the number in ascendin
for(i-0;i<10;i++)
{
cin>>afi;
ig orderin";
top=0,bot=9;
cout<<"type the no you want to search \n";
cin>>p5
mid-(top+bot)2;
while (top-<=bot)&-&(afmid]!=p))
{
iffp) Dayandeep English Medium School, Morvande-Boraj
|Progtamn +-7mplemertations oF ciass (Patio and Reciprocal)
Lfincludenumber; —
| asd obit,
Lfor-C inkizo pias)
geet eS(Science / Com
Robt: Suni. Potdar
janie
Obj CIF Put dertacd 5
getchly;
OibnIeE
enter number: 64 —__
the number enter iS 67-
enter pumber + 83
=~ Dayandeep English Medium School, Morvande-Boraj
Department of Maths / Computer Science / I. T
| eter number: >
the number enter/5 £5
+he number enter 8 Oe
merce )
suds. LTO TEE sign: J}Newiandann Radlioh Modtoe Gahanl Mavuando.Ravat
Program: Implementation of array of object A
#include
#include
class asd
bli
public:
int number;
public:
void getdata()
{
cout<<"\n enter numbers";
cin>>number;
3
void putdata()
goutss"\n the number enter is"<
Hinclude
class emp
pebli
ie:
Pyar name[20];
int sal;
double ph;
public:
void getdata(void);
void display(void);
b
‘void emp::getdata(void)
{ cout<<"\n Enter employee name";
‘cin>>name;
cout<<"\n enter employee salary";
cin>>sal;
cout<<"\n Enter the phone number";
cin>>ph;
}
‘yoid emp::display(void)
cout<<"\n Name:"<getdata();
ptr->display0;
getch0);
3
Output:
Enter employee nameKavita
enter employee salary5000
Enter the phone number9028474
‘Name:Kavita
salaryS000
Phone number9028474eesti edium School, Morvande:
Depatiay (Science / Co ree
ent of Maths / Computer Science LT @
= Std. EES |
Title = Thpleme ee
Tule entation of rand _destacter |
z OF Constructor and destructor_|
vane: - ROACE,. Suni Poctdar
em... Pe
rie epee nay Sop dant
!
Psgiomn* write « progiam tisha Lenten]
a ee TUStrote Use of construt—|
F#EInclud
eftLinclucle
#include
class A
int area()
{
return(*vidth * *height);
3
iH
(int a int by
{
width=new int;
height= new int;
+width=a;
*height=b;
}
Az-AQ)
{
delete width;
delete height;
}
void main()
{
clrscr();
A obj 3,4), 0bj2(5,6);
Cout<<"Area of rectangle is!
cout<<"Area of rectangle i
"<
vase regen
j
$i compe bighpvtid)
DOLLY LVS,
weit wai)
ae 2,4,
cs~oomaepel S25,
orem 410%‘ Payanceep English Medium School, Morvande-
Boraj
( Science / Commerce ) 6
: Department of Maths / Computer Science/1.T, 7
inc: RHE Sank. Potdar:
Sid: CATE E sign. :
_ eprom in
stile + Fimple mentation af condtuctoroverttading —|
ist. ca Wetteo. Progran TAGE us 1ng.00 po clemo— |
nStrate the Implementation oF Constructor pver— |
\oading_- $$ i
flogran + wrrke a program miastrates hawnstouver—|
ord rinse ae eae
H-include a
public; 2 aii
Abch(), es
ABC Cint int) _
‘tarea C9)
a eee
5
Apc z ABCL) ee
{2
Wick <=,
height =S3 —__—
Die pBcCinta,inth)—
a
vidas
heightsbs i —
P|=» Dayandeep English Medium School, Morvande-Boraj
(Science / Commerce }
ie Department of Maths / Computer Science / I. T.
PohitSunt|potdar_oa:12* tee sien fe
i __ Jal _
pce035
Peec objlCs 4);
ae
cout obi ureazcohjl-area() end i:
u 25. ‘
| cout-<2° "obj
. 9
J =
| Outs ot
| chifscanco, 1) reer
obyS. area +25
2 ss
iE Pa
, =
—————
=: Writ
ram: Write a program illustrates how to overload class constructors.
Jydesiostream.h>
jude
ABC
vith, height;
C obj16.4);
C obj2;
<<"onjI's area:"< Tmplementation OF Ni ptt funtion
mp AWAe a program 4O.CH+ UsiNg opto clemons=
totethe 4MPLE mentation ottype of virtual
Beicciwa 7 . ‘
5 en
peut ze Np ohosnderived
=|
ond eeeDayandeep English Medium School, Morvande-Boraj
A (Science / Commerce ) i
Department of Maths / Computer Science /1.1, (12)
p-Pobict.Suni.| pokdan. sas. Meesind ea)
re S. sen oO
bptt—> Show ie arogram: Implementation of yj
i secostceamn. > ion of Virtual mundi
#include
class base
oe
public:
‘void disp
ean display base" ;
}
virtual void show(
{
cout<<"'n show base";
}
h
class detived:public base
{
publi
void disp)
{cout<<"\n display derived";
}
void show()
ern show derived"
}
H
void main()
{
clrserQ;
base b, *bptr;
derived 4;
cout<<"\nbptr points to base";
‘bptr=&b;
bptr->disp0);
bptr>show();
cout<<"\nbptr points to derived";
Output:
bptr points to base
display base
show base
bptr points to derived
display base
show derived+ 5 ae Se giriattacind oe Nie
Rohi-t-SUNi| Potdap: wi A Pi
ii z Sign. :
inc: iS1nq Cops
“ation et-type mmasidn |
telurn radius:
Class tec
t
double Xcopds
| double ycord
publics,
fect)
cord=0-0%
ycorcl=0-0.5
£
J
fec(doublex dowl-c y )
ee
U .
cord =Dayandeep English Medium School, Morvande-Boraj
(Science / Commerce ) fe
Department of Maths / Computer Science/LT, (7
Pobrt-Suntl Portdorr «sas 9:tD tsp
= Eee
pip .gete
oot_a= <0 GOS _
Ct rd =| cco aye : a
=Sing): a
jAdisplayc) zs
\px=coson nero! a7 xcorc. 2 nycn-o mllna-e=|
1s :
ae
orc mai
acre ys =
Bpia-polcoatd (19;0,0.cfeng)5
poocd = pclCo a ae el
eit ppokicoo -crdinates : \ni
Piccard dishe te a a
subZc\n Rectangular co-ordinates {"
ecord- display C0;
Igetch C5
3
coo poll nateDayandeeo English Medium School. Morvande-Borai
id
program: Implementati %
eeeudecicstream,h> TOU Of tye Conversion
ginclude
#inelude
class polar
private:
double radius;
double angle;
publi:
polar()
{
radius=0.
angle=0.0;,
polar(double r, double a)
{
radius =r;
angle= a;
void display)
t
cout<<"radius="< samncey |
class B
public: int a;
public: int b;
void get_ab(void);
int get_a(void);
void show_a(void);
K
class D:public B
{ |
int ¢;
public:
void mul(void); |
void display(void); |
K |
void B::get_ab(void) |
{
5; b=10;
}
int B:sget_a(void)
{
return(a);
}
void B::show_a(void)
Poutectenicaeeath
a D::mul(void)
be ga
}
Void D:: display(void)
{
cout<<"a="<,
“ight!
clients
cfa>(eam | 1
Cen
Mead ™
Lilley
Tota) cancel ‘neach year
AI UMey
| 4 Head}.
Body’ se
‘Cable Boner! "er. fadding"sa')
etry ee
“Hh cobspaqeo "nwwgpane "y's Year