C++ Viva Qsns Solution

You might also like

Download as pdf
Download as pdf
You are on page 1of 17
pop pe 3 Large « programme — is, dturclecl\ into | Sma funn. ~ Emphasis on aigorithm.)| ) oo) |! \ > funchion | share gidba) data) > -dgiai-move. function: to. functdn. . |\ 1) 1) 3 Focus on Function = than Aang | J programme clesigh poiows top to bottom. HOUT A vib it Limitaton vyleut ead here yt 3 difficult “10 create new datatypes of) |) > 4 olprewie in aesrgn. 3 eode redsapnity is diffrcurt: yuu i 3 po Acces, specimen im, pry, Te WN ey {oie al PWR iy y Diy (3) bp 1 Cop Typ of paul > Fotus on datq than gorithm. 4 programme divided into ff Objecis. 3 DHA is brddeny WV pWay om ged > There qré\ qccess specetier. programme: | design ; 4ON0WS bottom to top. me Ym buy PA pat UW (GOL Lying, ver a Features of OOP ®@ obTect i 31 is funtime entities. Qua ery at \) 9) eMmthies| represented as \obfects\) | 3 Dad & Function gre ted in obyect- wii uy heeee Oke; a LA It is\ “colestion OF voRFed yp ny pias eta DM is “user” defined dag. ape | (ona Se 2 It 1 impiementarren oF apargee ata) tyRR. | iNT PU is) temprete Pr (Spe cifiea 25 Their, operation. VIN Aa Aaa AD e984 @ abstraction” Oy 901 YOU ARE ST Ta PAG Oy 7 Clas | ate the concept OF Gbstraction- i 7 Ft plivide ~ absiracr, class; , ACUNAIAAL > Comprentty, oF programe reduce, > Of Tors Wiest A aT @_ Encapsuiarion, Win 1 tinea ala e | 2 Combiffarion” OF dara and —Fanetion, f RO LOH Ik wraps (d§) clata de Fundiion Jo objeer- A dara hiding 18 Qcbteved- i HALOS} Wea AR ae ago aa Inheritance eh Dag. 4h OTT Hv MAPTTINY =) property OF ong, Crass) Is) Coried IDI another’! craas ris) five Solo) Caled Inberitence.7) ) The idea OF! clas” jeqds 4g dea iOF Hinherttanees oy) Property Oh patent Class inherited by child Class. a WO qo Ao] | © jpoiymorphisn” 7 a ies ed aoa |) ope name many “faiie: Nimo Sita Fr. gpa oy ose Operqior OF Felnedf OP 0in drrpereny way) depends on dperaion. Two wee | 0 i © compe, me : a a @ run time - 7 @ Message passing / wy 4 Yo Obpeckii Ommynicazer | through" enwoKing Wethoa d>, Senaingi;dgta tol theme ged yoot AotW iedy a) GS 8 { ® Dynamic binding PATH EMMA ey > achreved On runtime. ih ft > omy possibie when ‘rpberibene & wed and Obgetr Ate — Aceessed shrough \ pointers. \ wt 7 pd) Git caved late, bindiNQ-|sy / | i ESTES Wl We ee LT © Reucabing. ra : > Rewe OF tode. yuyor 4 MoV RU SOQy GR eal baton Cat Sgr Advantage oF OobP FUMIO MOV ARS 1 > coMmpleyity oF — programe managed - = ~ Code reac bility. ' PTD) Bb ‘provides qyeany | modular | sfrucame. ji) yi VT) 4 system Can be easily aPgRadee aT 4 easy the pop AOHE I AT ERD Fay Way), Liver: 2 models jhe redh word sprdbiemr. Ta Disadvantage YM DI) bode toa ld [> Requiten more Hime; yin Compll@fon) ) i 3 UF is “sewer! becque large) give. i > debugging is’ difficup. i : > HH require |} @F work to cede. YL wtb A Ie i Peper do Abstraction mechanism Ty spp gy 2 Tt 'Is\\ the \process OF “geting Vaerail UinFormarionic Qctordin, to the level of deep sighel iol thei | probiem. + 3 CIGses Gre the concer oF QbstacHion. ' 3 ComplenFy OF programme MaNI ged. | iT 1 1p me Ir is 3 Ture MUAa if dite 4 ae * 4, ‘ 1 i HOG VATION & @ protequre one Fanaion. i ET pad 2 Collection oF enecuFeql fase) CoD Ge ina > dubircating “fam © reuse. oqo 7 Unidad ‘© BIDCK scoping i Ww oppo) et > iF Furchion fs nested then Block stope Is Wed. 2 Uots por ituery Soiution. OCF SPeTIPy Di Bopmina oaperg yy YMNOr Hs ® moduies Widy aiey Ba), 3a HO SUPPLY ttoport. 4) 1 CdtPOrH! stotemenp. ITI 7 > Te CONFTOY vistbitity Felgtures. TT" a) 4 IF sowed problem =o @NCApsuiation. yoqr 7 Ht Leta Ipey 1 “@® Abstract dara type 4 tH ‘Is sed dotined data type. Tayo | at gives fPFOrmayon for’ ‘agta praing: B rearing’! many” ~ instane: > messege Passing i AOE) poscipie . i?) to welt) Milefordep Do) AD Sa rine Ri data hiding I Soir ts the sare OF data. Be rccess “specter sed: - QOOYOISS 1osiream LOW [9 It ‘isiqi Nheaeer , Arrevuiy | Ws Wel Tk Stell ous wore with! Fnpup 4 OuFPUY Obzeds wy 7 1G F494 | sas COU. si | naive spqce q | we Can make ure nome, FOr Obsect. 1&l \varrabien from standard) bray Vay Using =NaMespace- | i it ywipaey © dara bat Moat, Vip k C1Oss Re 1t cfs user defined saqiq. \type: iit 3 hods Agta abd! Function —dogetherii 1 2 The dara and fahaioned vinstdey Classy ieqned (cidss mem ~ The data and variable are Coed, member. & Fynciio are caied ember Fug > crass has. | propertyi\ oF arg” hiding, fav ny [syntax : dlasan) Casename] OG Cidss Car piVielass CARI») ut sht 7 (ig tosida sodto | adn ObTeCh. ih Wai. pave 38) 1 adam DIP et a aF is class varrabie. 77 il 3 at fs ruptime -@ntitles. JOAN) today > creating. (OF. GP “Obyect js. likey «defining Q~ varlabe OF neal t M MLbAyT i datas. type ly | [euntws \clags-name Obrett-namey ny. eg. rectangie rat. Traingie 1, Tj tan io a . Avi “ecope Fesolution ORehTOR (Ppa Wa ta gt is used fo define q° Funeton outside the © “15 oat _ use to Qctess he static Variable (OF cise, | Access specifi aTF feis Zl Accessed: —_ pubic) ey TH ew + Fy Can be qecaned apqDRER TA, Vt —4 2 dard member and member Function gre Visible 7 Other cas. a TF AIA merbers! are | deciqreo | in this isect op daty ~ hraing | rue ssi ivfojeted. | Hig Tet 8 4 usualy) dat il aeRO bee ie af hot deciared, jin © thir secon. het pil ty il Ih sdb Se | J @yPe te YY] 2 | 4 1 Cabt | bey) vieWed” “From 1 Oursrole? TH 3 OMY Claes | Friend! Functron” ~ qeeas, |] 4 TW bide, fH member Vanable st) member) Punctron from other clas Obsecf 2 Function . > darQ member are deciared” in 7 this! Section) Tat THe Member —Funeion 1 TAT T a [>Re T varigeie” deciareq inside the aaa now AWa Members & jhe Punctl Are CAjfed ‘member Pun”. > The opergioni requireg | Por | ani \obdect | S| define in Ut. Need OF seope OF fesoiytion Qperator- ~ ‘function “TS “derined outsrge the clas deriniron, Friend Function Th i 3 It violates daq ‘hraing. wl mB > Url can be accessed private profeoted day oF | crass ~The body OF Funcibs 1s writen ovtstde the Ce | 3 The nob-meber Fupttth that Cn have to private” emermber) OF | @ agse | eqied resrepey Puneton , 3H) asuqig Mra Ohler a op “orgument. A ip deciqred either ip pubic OF private Section Ret = | TTT ni Friend | return- 49 Fandon~ name. (arg) « Thine TRIVGHOR SR t I 3 IF is used fo reduce the Fundion cau Overhead - 4. TE ts ipowereu) concept Tiic.t 4 Th. TS j)eypanded ip line When FF BS invoked > tompier replace = functon CAN nth =Punetfon code 3 IF 4 Function return’ tym. iS Other than void ih Tetum, statement det ert ih Funeiton bed [gvitons inline _telurn=iype _funciion— name (arg ist). QoO04oIgZ Tite Bo Message passing DITA Parc Ia It Ts) 4 piece || OF COmmuniestion) yor > object Communicate with help oF message — pausing. 3 data 1 transfer From one | ObTech 10. qAnoiker- —) R Message is alaway given 40 some Obsect Called Syma; S$. getdata (x) ; Vd) Paes OBIE GAIT Tmetage «RAT Operttor Vive Wop dod6 sda VID HPArMEN —bonT 1 RAI constructors a 1 MUON ye i > Tis specrqn “tember Function. 0) > used Por Iniinization oF opyeciso) tan! i Fst Spear “because HY name is same as craw name. 7 1k execute whenever obyect creaied- 7 + Uk should be declared in pubyre secjion. 7 7 J Tt cant return vaiue duc. to iF does have rerurtype even a's Types. wed. © Deraurt constructor — > R_constructor = qhat = -qetepts no argument. a User NO required +0 speeity. @ parameterized —conmuctor a constructor dees argument cailed -pqvamarerized — epnaitize (@ cory _Consiractor _ a u's “used 40 initiize™ One ongedt _ from “another oby whith hag _qiready been initived- “oe | 57 required one Obsect argument. = reani@l han aaa Poo ; — SYM}: claw pame ( clas-nome ~ objech” retey iene |

You might also like