0% found this document useful (0 votes)
74 views67 pages

OOPS Practical Mine PDF

Uploaded by

Mr.Hacker Anup
Copyright
© © All Rights Reserved
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
0% found this document useful (0 votes)
74 views67 pages

OOPS Practical Mine PDF

Uploaded by

Mr.Hacker Anup
Copyright
© © All Rights Reserved
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/ 67
INDEX rT. NAME OF EXPERIMENT DATE | SIGNATURE LA} Write acti program {9 create a uloala: imple Calculate s+ B-} Write a Chi _preqram Jo cenyert Secun/s} Llosa} —__ into hours minutes & seconeatc. S| bite a ott progecm to fine “the velvene| ‘Heal of | Seua 0 yestang le: ; DAL poy CH pregyam te fine th I fealaa - Greatest af Flee Numbers = {Write a CH pregyan to Aad the sum _|ilerlzal loP ew ant ofl A netural numbe ye | Write o CH) pregiam to genevate an _|atfesla. “the Prime numbers | and nm where if yi||—}-ois_a_volue Su ppliect by tsey if — : | Write a CHt pragvam Using Clases ane |3, 1 Objects Stuclent te print mnemme Of fhe | i — _| Statens, Roti ne ans. el’spley The po | Same. \ i ' | Write a CH. prayram & = || | (SA re ctuvect Bank 3 ileal, bent eenplyee to _priat bank oF the —-Lempisjyee acceu nt_no_anel balemce, 7 | EXPT. NAME OF EXPERIMENT NO. DATE lisplay “he Sem atse lisp lay nthe halance affec withdriss ancl cbepast— Bioah3 | a El | ene a ctr program te detign & clas. having States mem bey Rin ction ham Shaewoceunt () which has the property| lof displaying tHe avmber_ of object Created of the Cla DY Write a. ct Prcagicaen Fe Reet marry Jiozbaa autef 9 nambere usin 9 fatrer 3 faction. EV wire o Ct proqram Using Cop 4 to another object _ | Comstweter to Copy clerta ofan object | 06] ours | Aral Wyite « CH pagram to clesig, a cle Llp resenting Complex numbers Anof _Loblav lea | Ace itor @ ma ttip Weertion of too _ | Mambers USing Operator aver sleseting Tle te O Che progitam fo _avesload new/ _idelete Operators In a_clasc. heaving He Banc! pte lity of perBemingl | \ t INDEX eer NAME OF EXPERIMENT DATE | SIGNATURE Ne [Write a Ott program clo a cce 26 fall I 7 members of a STUDENT clase Using Pointer te shjects Dj urite_o Ctt pregqram To Generate | —fibsnecci series by sng Con Struc tax|ablouhal - B —te_initvalize the Ocrim Members. | - El] brite OCH program that siusrate elowos Single iaheritance: | WA nies CH_pregram mustiating how the Consty wotocs ave ferplementect_anel — the order in heh cHhey_are Cattecs when the Classes are in beqitoos Use s three classes numesl — al ph ha} beta | —{9 Janina Suse b that alpha, “kets dee ~— base class _anel Gamata_/'s scdesivest | | —Clase_inheviting alpha & beta _ ! 5} tite. 0 CT Program t2_Seoqn a Guolat : | lothh nt ee Stuclent YOU nos and qi itest tase (deviveet Class of Stuctenty | Lass sete te Keres of the Siturctent | -inVardous Subjects and. - SPOTS Cia gs _|Yepres PIESerting athe Sore in spovie- The _ 4 | Gir inna ded ciate alee be __. | INDEX eer. NAME OF EXPERIMENT pare | SIGNATURE Linke rier bso reguit Class hau'ng Hh - fan th lrg fer stotea th Kove ancl chteplas the Raat result Rye Stuctent: Ell write a CH program to Mmafntain “Hs loeloulat _ | fecevets of person with cletails (Name anal | Agerane fra. the eletest -amens them ? | the _pragrans must use Phis petite fo} | ye ruyn The result + = [vite 9 Ct program Hastrating the use offesloynd _|Mivteal fonction in sass: _ GV) write oct program to copy The Cantent Pe ie | ef one file slo actress A] | Write 9 ctt pregyan fe implemen1 “The —_lotlauind __|exceptten harctling vaifh vethraaing ty | | | fefeptios te] Waite a CH Progtam 1 Create Simple —lotlour: 1Ca(Culater Using Class_.template. | ___} i I MSin 9 Name Spa ez td, Ss fat marc } é Chay Tok nt on hs float an * 7 Cout_ << ¥ #¥ HY Calculatoy ¥X x ¥ 3 \n es 7 ’ Cout << An Enier wo ny mbeves \n”) Cin >> nt >on 7 Cour << \n Enter uy Chafee Vn |e fell ton No 2: Subtratiion We 3: Murtisicetivn Vn ty Arureioe, | Cin Sd chs Suite, (ch } Cage \: Ans =nitnr: byeak 4 Lace 2. Gn FWHinsn2 5 brea + Case 3° Ans =niknr? FOR EDUCATIONAL USE 7 nents Cose te. = Ans se net dnay by enn cle faut _ i Coser fs savin el Choteo—; ° = Cout ss \n Resa 2 “fern; X | Cont ss" \n Do you —unne Cin dD es eushite Cos =) Yodurn 0.5 4 Goraaranis FOR EDUCATIONAL UST: Qurp ult Dev ett BEY EL cateuteator entry twa numbers 1 = entey Us Chevce 2 I actetition D+ Su ett action 3 Mu rtiplt cation Jy DNiston Ree want to centmue 3 aq pigeitcet 4 ig) tovite 2 C4 prageam lo Sonuees atlas hewec nainute s fl $0 com Gas FOR EDUCATIONAL USE Practical 1. al Gyite a ett pryoey bo Pin 4 “the Vetuns ad SG uo fone Coy fe H inctuele <0 Streams gm g Name cpece ste int Cube {int <) 3 Cour ee" \n Volum P cube << SH sx vid Yectangte (int fy int wy int hb) lout 2¢\_ Vole Rectangle, <2 )# oXL: a jot moral ) £ jat «tel length, wiehtt heig be: Cece nt Enter Side af spvares\n” Cin >> sielos 7 Cub (sche) ot ce \n Entey lengtt utelth berghe of recta n gl hn" Cin >> lpncth 22 wieth o> whe ‘ghe Yectanale (length taictth bergbt hi _ \e-tu pe 4 FOR EDUCATIONAL USE Outs 3 c+ Volume of Vectangle + lo Hi inctucle > b dec. iP (a sb&ha sch Coue “ & Jeturn a q FOR EDUCATIONAL. Outputs Entey three number: 4 Ss 5 is greatest Practica! Ns _ DU Am: tote Cit preg tan, to at tte ten of oye ~Iloaa a Pie natura: Number code Tinctudte Using namespace Std fpooincy a ints = Cher ch Cas; Gus $< inter ang umber, << eadsd- ci 220! if C nay. a2 =o) Cont eng << v's een \n” eu ye eene << 14 t\a” 7 Yetuyn 4 ss FOR EDUCATIONAL USE Mow 9 ct _Pogkam 12 genetate ol the pa engl 1, Where 2 15 2: Vvetee ppliece tase int n nS hi 1 flag Stowe, - tec Ends oy numbe <>no+ fey (ist: fe seg ti) a tos (jz a jee nas fee) if Cil =7e&i% isto) FOR EDUCATIONAL USI, Output: Dev ott Entey eng nambey: 4 2 peme | SB prime practices Ale Aino’. WWeite ob _prsgrar using ele pbjects | stuveat ts priat nam fthe studenc, Roun et. i +t na. tpl sede tH inclucte & ra pace Shs 3 Class Stuctent o = - in€ T nos bay mo [to]: Pudlte 2 Meid setefatol ) eut<< \n fats wotent Data!" Sout" \n Eavey Row Amber: Cin P>¥nos Cout? Mam ¢ 3 Void _getdatal J w 7 Contes Wn stunteat Reard + s 7 pees“ Rat numer! << tnos wet <<\ Dustent Mames nam 4; int proinc J Stucton CS Goes} S-Setdata Os FOR EDUCATIONAL USE Sgetelat a) Verurn of Dev CH data’ 7260 Enter stuctnt entey Yo numbey entey Stucdent name. Sumié Student ecord numbey rel Suchen & 260 Name > Suum'¢ et'cot Na. Rf tuxte a Ctr progres he Smctuvent Mand leak empl [te print hank of ff, employe eCcoun 7 ke ciShlay “the same acca olisplay the bet orth etva wo ffs pesitr Coe HL inclusgte Using eamecPace chet ~ Struct bank Ss Chex ma. [rol; jot_ccens; ine tals 2. Int woithdreaes (int bal) Int amt + = ut se Wn fater amount fe with tras! Cin 72 aon C4 — Yetur L- be & int fepostee C int bat) nt amt) Contec” (ny Enter amaunt te he alepes': Cy >> te Contes” \n fntey bane balance!” Cin 23 bho te Yetura bal t amt! KS FOR EDUCATIONAL USE hen bh: ccc Nn fetey Mamet" Cin 33 be ne, | Cour <<" Ny Entoy perenne ni Cin dd bace nos Sources" \y Emp tages ctetan « St. utc Nn Name 7 Cout << \n <# Count kee ohject cteated x elemot) | AY cunts R 4b int cleo fount 2 oO) int maine) 7 7 Count <2 Static Nema aclem oct - dlenio!! Sheu coun eC); demo cll, A275 ctemoar!, ShawcouatOs demo, Ady . demo :: Show CountC) » FOR EDUCATIONAL, yeeatn 9} 2 Static object object object clemo Cre ote Crearee cleateel Poachtsut Noid, wt of 2 june space stel) i Clas Bs. tase A AS |] Airs town a pray vem fe Misch nt eurd oun ——]] amber s tists Avenet fumerton: — _ Code’ Poenct int max CA_m,R nd; Votet oh Cint_& } OtxXs Cavtee\y Value of a= "+e & 74. Class @. £ Public: int bs fienal int Max CA m, 2 yn) Note Shawl iat) é b: Cout ce Mn Value af he" <<: 4 4, eas FOR EDUCATIONAL, USE | I tot max (CA om, @ a) f | vege pra dnb 2 mia teh: i int) z Gout ce fivenct Funerx Dem < Luiing namespace Stet; Cloes fam — Pash _| fut a, bs leme (int ¥ tat y) ¢ Cout <<“\y Pavamete Const tuctor”; asx: boys, dems Cd cons LP) or Cot ce \y Copy Conshe tor’; Ms p-a* he pbu x Votat Shaew¢) ~ ? cet Nn value ofear < Year =o oO? this > Img = 0:0; § Com plex’ flat, seal, Pleat ions) Ce Fa ths > Year =veals Hic Dimg = ing 5 Uf Ovesleading + Ofer stor Cora plex operator Ccenst Comptes Boh) ¢ Complex temp; femp-ietg = 4ts —> img tab} sinng temp: Feals this > deal + oh}. Teals Sas FOR EDUCATIONAL USE. = Vefiun 1e nop) Ifo Vectaradhing * Deerater Comp lex operects™ (Const Complex fahj) Z Complex tem py te years (the eat * obj: lea!) = (this >i. temp 4 g 2 this? less Objingl a (thicd feng xXétur tem pj 4 Void elé'splayC 2 wut << this beap << +" i << thig> img =e 1 “Sen ssi 4 gy jot moins ) Copaplee aK Ceut 2¢ Eater Yeu! ane Campiex Corflcunt of the fest plex number S a+ reals Cin >> Quins + Conte Enter Yee! ano! Compley Pextere of ts Se cone Camp ler tuber 2 << Aol f; Cin >> b- realy Gin f,img) . ~ Cout; yen 8} Gutputi : Dev cet Enter teal anes complex CacPeient Nun bow: | Son Entev teat anc Complex cae Pervent Auber + 3 f Addithan Pesuif 1e4 3 Multiplication Peguiet qa titi of tke of the —a» Fast Comp lex Setond coon plex Code’ Dvectien: Nols Wie qg CH Pesan, te svevinact necw/ ole fet opeveateys jn ofa Hilact st tnetude < sroflib.b> Ustag m¢Pace Stel) Cla. Ste clerrt String frame Taame + $ iat_ase publ: tuclat C) z b . + Cout << Constrwety is euiect bn g Stuclent ( Streag fn Sting Iname str age) Hiss frame = frames thc Tname = Taam thus > ge 2 ag 52 a Noiel cbcplassl) Curt <¢. First No cc Prame p> afscplag () g ale lefe Pi FOR EDUCATIONAL USE. Output Oev car pe ee V loading new opraton usith Ficct Nome : Prince last Name + ade Age 290 DNevleacing delete Operotoy class Using painter re Cl pregvam ‘To cee ss ign Cint by String al ut <2 the Poy no ef stusene 6) s lata mem be: «.™ ptipty = Joy pts ptr= "“Sprube”s FOR EDUCATIONAL USE. ” Corte” The Value of Patt mate “ee pobjncy.” phiphy <2 onthe Cout ce” The Value of Narre ts "<- + abject. *ptegty — west es Pee Stet +, + Ola: ib ‘lest jbl: mz jat__f1, £2 fg: Fin tece Cint a, ine b, otc) Plaas fo ab fh = — a pid Sheu ‘nt n) o Coat 2a" \p Biba ance’ Senieg as Sonora we cnet ts Cout 2c* Ip i ox lee” yee? Loy Lint f sain itt) = fi. fist Fiaf foafth; Cat <<" "2c Lu; OR EDUCATIONAL USE Int mata C) Fibtest (21,0); fishovo (e): Yeturn 04 FOR EDUCATIONAL USE, Fibonacci sees = at 4_progx. cthed Nrostyate Coefe’, Hl taclude Using Ramo space st; Ck Num bey Publics we Jat neem 3 Noid set mint n) Numan Cout<<“You enteves! < i Lasting Name sp. ste | ct cdph L Publics I int a+ Alpha Cit x) eunXs Cout <<" Concteuciey of alpha lass: int bs beta int 4) cout ee Constincter of beta clacs:” ste mecp cet lass tradenc Pub at Yeo sheing 0 Void Setdata Cint 1, Steing a) Yoo = Ram £ Class Test: public Student. publi Int mi Mo.m3 my om Netcl SetMayue( ) FOR EDUCATIONAL USE. wee Catey Marke fy Subjects << nett; Cin SD m1 Dame >> m3 >> MU DDE: £ 3 Class sCave 2 PubWes int Noid Set StoreC ) utes Entey score of Sports: xcenatd Cin >> Ss. a Class Resuit: public Fest , Pr ble ye “public jot totaly Pleat avg; Votd printRe sure O) totes Em tt me + m2 t+ mltme, vg = toto /f uttc “Stuatent Rov Noi << tne <? Aa J; Ager! << enath cout << “Ente Qn >> 2g) By Cint iets is cy ity) _ #lageLiZ 2 large) lavgeis og CID: this pe cage Ce], athis => ns name Lr], 4 & yetura * this: & 3: Int main 6? = Person Py p> set Data ¢ yy prelelest &); Cout <<" Name @” << pens Gout ce” \n Age = "<< po Seturn 07 FOR EDUCATIONAL USE, Dey ott Enter Name: Anish Friey Ages 2 Entey Name An Ke Enver Age: 20 Enter Name Minge Enter Age: 2 Enter Name: Abrnav Later Ages Name ane age O2 eldest person Nae = Abney Ages Ager 2s out oF Practical NO% _ Bim Write t+ preg tao iilusdrating the use of Wste conc 48 Sede? _ Hhinciuele Cio stream using Aame (pace Stel: class base Zz J Public: int be Noid pent ¢ ) z Virtua! void Shao Cint x) Cout ¢<' Shas Methec! in hase class!” priot Os ptr — Show io); = Caut << Pointer paints de cfeviue cs clase \n' pty = Gel; pir Dpyinrcd) Per > howl 26); Yeturn § FOR EDUCATIONAL USE iMod Classt” cf Hf inetuct HRKin clude Fiinelucde © Stetto b> Fone Luete < StH bh» Hein ctucte of strean> Using name space Stet) Naict Cap 4 bile eontent ¢) Siving temp» Petveam fier, fie >; tin be fret open (" stu tet” toc: Peg. opent” Stucopy. get “ins sour )) fied cock. gl @, los:theg J; shite C filet >> tem p) Sieg << temps 3 fet .Cloce C2; Fite 2. Close 2; 4% Int maint) Cout <<" Copying Content foam stud ty stucleapy (in Check file Content on uy alvive ” Cm py, fre coment (0; Cour ce \n, Copying successfiiy, clone 1! Yeturn 0; FOR EDUCATIONAL USE 3 Dey c++ -4a ¥ Coming Content Aum Sted to sted copy Check Content on uy errve Copytng — Successfutry done | Stu -txt ~ Notepaw ~ le Fdit Famet View Help Lo ANISH KUMAR CHANDRA OHAGWAM Lat, col 4 lao Windows COAL After Copying file te erother ie. stustet to Ste cong tee | Stucesy tet — Neteporel 4 File Felit Format Vieu Hele 4 ANToH KUMAR CHANDA ASHAG WANT HA | Lateat t leat, Win foe CCRLE} OTe ‘| racticg: Na+ d p. Aiea! \oyit Cit pregram Ye fe ple me the _ekcenbieu. andling Hh vethyavotag except ar Lode’ HE incluale c'e £t ream> usi Aa mefSpace siety Vaid My Jun tx ception C) _s. oy thras” Welcame” g : atch ( Const chav) 5 7, cout << |n frost. Mudtenfxception ght 2k cepire: out <<" ln Rethiea ing cepiion” Ahcnwe | [12 Hheasing tks eption ae jk main ©) cout cen Beaing with Mara Me Hracl Ose Curl try Zz My 60 Ex eptionl); 3 Catch Cogust chor *) a 5 ut Ze Wn Thoele Matn Cousht exc pti FOR EDUCATIONAL USE ut <<" ln sfhey handling exception Le main methad”s Netucn 0 oO o FOR EDUCATIONAL USE per Dey ete th Moin methed execun Begns pie My Oana Creption cought €7¢ ception mere g exception Main Caught exreptian Mer handling ception er ding with tain Wethost Practical Na-lo Lovie Crt pres, fo create Simple Cateutads. |_tSin gq Clas deme late, do inclucle Usin amecpact sted template Cla: Cofcelator Private © T not nod: publics alcuietoy CT 11,7 na) hot Zot: Rem = na? 4 Noel Resuit) Cout ce Number {= "ee not << endd; Cout << Mu wbey gees nor i C2,1)5 Cateulatoy

You might also like