Professional Documents
Culture Documents
AssignmentNo.: 03 Date:
Assignment Name:
beyi Dnaiclon
i voidseta(intz=o) duabolans9N
q=;h
3
void setb (int y=o)
b=yi
void disp)
Cout<kerd)<<"a: "<Ka<<'b: "<<b<<endl;
Assignment Name:
Lintmain uttaon
const Test t(o,20) hiasah sn
COUt <<ta<<""<Kt.b <KAn"
tb=l00;
cout<<t:d<c "<<tb<<\n; iclaa
retutn 0; aolanxe
gSAT
balhei tat
halh Expliotkeuuotd 200te
JF s used to markconstrucorstoot
implicitių convert types ioCttoasmnoliat
incdu de <instream>
using namespacCe std
cdass mplex
pCNate
double eal;
double ímaq;
pUblic:
Complex
Cdouble r o-0, double io.o) realCr),
nimag()
bool operqtor ==(complex rhs)
Assignment Name:
íntmafnDi ikot qu
Complex
coml(3-0, o.0);ilaa ht
odk balt)
apielseiibn olaan
cout <<Not camehiy atia DAMLIU
retum o; 29d11t
io0)9dut ut
t
SamelxC)
Assignment Name:
TIME
LiL j'pa
RUN TIME
COMPILE
Assignment Name:
20ctbguint a= 5
ldoubleb=d;wiod tk la
22 return 0;in'
hattaci hubai
tbaiodtbiy tai
5)ohat ís vittualAnchion?HoupÎs itditferernt
ftomfunctfon
auertidíuaun b bioz
→A vítudl tuncton Ísusa:merbetfunctíon that is
decdared uitihfn a base cass and rede nedby.
Laderiveddassannl it slut3 221
Avirtual tundicnfs a funchiondedaredio a
|base doass oththe keuOotd "ictual indícatiuą
that it maybeoverrídden byicderivedclasses
Mirtual Auncions enable dụnantc dlspatch,
allousiną the apptbpriate. ftolbelcalled based
LOntheactua)ype t theobjectiatruotime
Funcion overridiuąon he other hand: is te.
Jact& pIDvídiuaalcpeiffeuinplementation
Ifor a rtudl in a. derived dass:t
Jallous the derived dass to replaceor: extend
thebehauibus¢
the thevirtuql nherited
from the base dass
.(2
2aulot a add
Assignment Name
223 reurn 0;
20 221
5) ohat is virtualAunctíon
?Houo fs it ditferent
fom
functfonabverridfna slr bio
A irtud) tunctionÍsamembet functfon that is
ldecdared nithin a bdse dass and rede.ffned by
la derived dass
Sit lt
JA virtual tunciun fs a Auncton derlaredin
220
AssignmentNo.: Date :
AssignmentName:
Noid displauy)
înt main)
employee of3];
fstredro 00001
int i, 0
fopen
("blG.txt"); iasz
eout <<\n HowmanyEmployeeinftnaton ?:
AssignmentNo.: Date:
Assignment Name
cin>> n toat
iloout<<\nEnterinfo ofEMployeel u
forhCi=0i<o;itt)nhr
cout <<"In Enter intoo"K<iK<iemploge\n';
oLi).aceept(); 9)342 9
f.urite (lthar*)fo,sizeof oti);
fclose() ia
f.open( ble.txt"ios::in);a it at
isily
Cout <<"n Into ofemplbyeESis
11
AssignmentName:
Enterinfoof 2empoyee.
megha
30000
Info Ofemployee is:
rakesh
"xT. d:11
sunil
20000
ImeghadE Abr
LID3 :gibt001 r
30000 eti :iI inb
9Explain efror handlfua inle Io oith cutable.
is quite
ohile reading. data
tommoo that errotsiimaų occu.
ftom a le in Ctt or uitfug.
Jdata to a le. FaA eq, an error mau aise
due to the fellouiug
hen tryíng to reat a e. beypndindícate
2When trtíaaiito ead aui ilelbat doesntiexist..
3|1Ghen tnt ua to Use a le that has not been
cpened OL
4utheniyíug uto usel1a le inian inappopriate
0smcde.
sTuua to
t wntetba
read-onlyna tle
todhi
Assignment Name:
Híndude <iosttedm>
#indude <btsstdctt h
int man)
FILE* tp;.
charfeedbackI l00;
Int i ("Geeks.TAT,"w";
fp fopen
doasot
(fp'=ULL)
pintf ("\nThe ile tould not be opened")
Openec"
exit(1);
printf " InProvide.teedbackthis_asticde"2:
Hgets (feedback to0, stdin2:
for (1=0, í<feedbaukLi]; itt)
tputc (fedbacki], fp);
sini ifftetror(fp)) ihatd
pintf ("n Eorwitiuą in ile"
fortf slic
lida
fclose (fp;
ot
-n
a
e)Explaín theitfollousing
192d
leLhandlluaf .
1:open)
toitBestablishestheconnectionbjo.a e a
le descrtiptoa Jt teates an open e. desciptíon
that reterso ha ile and sa
open e desripto
that referso that open le desuiption-
Assignment Name:
2-aet()
tfegdsa single
chatacker
from et
3getine)
allons ateptiuą and feadlíug. sngle and multiple
|iine stiwqs ftom the 3p aream-
4.tellą)
Tells n position of get-pointea
22Dl)
221l 220)
iuai
5 seekg()
NT
tmovesgt pointe. t a-cpeifed locatfon
6.ceekp O 220
Jtmoves1put ipointebto stheimenionèdJocation.
Assignment Name
till (
b jstredmwbtst biioStreampn
Dint
ifsiream ofstream
blli
os class. staiog Tby
aaití2oaa
Tuic dass is he base class for all tegm.
clacses The stredms Can be input orlroutpute
streamsb9h
stream dass
-4oilrmae bÍstteam class. bandlesıithe tuinputsttedm
Ct+ programmív lanquAge Tlese input stteam
obịets areiusedtoiiecCand jt nterpret
Hhe. input as acequence. charäcteis
1O b92 elaion
II Handles
ostteam Jass.
Gpsstteam: Theit Cp sttedm objects
are usedo oite data asasegueħice
chalacteS oLthe iceeen: bd
22:1g
a#]ncudebctteam
ncing- namecpace std;
lSnt
malnt)
n
: ieitte