Partial preview of the text
Download Object Oriented programming using C++ - unit 1 notes , Basic principles of c++ and more Study notes Computer science in PDF only on Docsity!
Una NO - tL Shape ae —_| Frincrp) Fs OF Opzect (R1eN1ED froaRAMnn, Al _pikterente beter Pacem _arfented! prpgranana fg — and obtect avon led paegrararn 198 : pop oor. tu POP, He program. 1s WA OP, Puke progr. bs divided indo cmall parts aitded —woato saath —_ paris colli duncHon. called object POP. dylows dnp abcow OOP _dpllavt bola. __ at approach approath. Qtnere fs no arrers 0OP has _gecess specter specthcy 9 pop language. 7 77 Jd } ihe public pivale protechtel. 4) Adding” net) date and Adding new dein and dunchonw i alt duntHowr +5 “not Bas 4 PoP is ese pot based on OOP ts based ane a a rel world reak --woorld. fuarnple! ett , Java , Ly boor 4) Exanaple. ae Ci FORTRAN Pasta : aH: C Scanned with OKEN Scanner Built ra pata type — Pago No: me Dato: —_ Ba =| _ C FToleney |_| Flog Hing void! [function point ator i. ‘3 \ / = envmeralins, ——_——seerang, Lo lonarl loot! |dowble Data Type Size. char |_bute spendin 4 by les unsigned tnt 4 by Ks stoned Int 4 bu es J Shorks int [2g He uosignted short int 2 by 4es signed shore mt 2 bytes tong Int woh bytes insigned tong int | 4 bates J wi ro st¢ nso! long dnt 4 byles pload- 4 by les double | z by led wi dovble | gb le 24 C Scanned with OKEN Scanner _ wee Cott: ears: parvntte gperasors re ee | fitronstie a ppertibrons Ite _ ace oe lb a eft: : viHpliate bratho~ ol ee a cet pret Allowing 7ypA 1 fie ab 4g, vd. una Briere operator _t- Tht upper gota. ted Ss ee ee s d re, = eran ypoy. DL Kina Arion ae que bing itt A _ aude uppn _tus0 aperands_- fat exormle / Keke. — Kt tH, 7) aa f x [Nodulai)- . ; Relational opertors ane rtlaponul: aperators ee cor refer, fo de _refabwabip dnat__yaluex__ arn have Bide one ander: pelatwnal operabors are vstel 1 rormpore tw? ek ax ___@Xpressions do Calva ‘to relatinghip» qu. ve ladtoral _expresston. reduns 0 iP fue labo 13 Foye rd ved Jot fre reo oy Aue C Scanned with OKEN Scanner ee Pago No: Date; —__ PL ENLR TNS shape Lowsvau Ope redo. Ve Lasal Onoator, oe DOVE tan hay In (d+ roernbines de result ot +wo xelatonshtp ‘nese Cx pressiyn j. Toe_mode od- contetliny expressions yebers ap Jogtc and die KK PEESSfOr 5 tog scad EXPYESS Gre ollud clasteal LEWCRCIO AS» due lon retums & fos vesuhe py Awe and 375 rebyry fp _ resold ys palse. Cxin | 2g bad Assianrru nd Operators: Assignment} apeeadnys ‘ftdad— ove: “pred b assign tte mperador pr fue lefts de pale On foe bast AdSlgwnent Gpevitoy ¢ de” =’ operafur. hg hits Jue Co reper ed 7 Shorthand og PGn msn} pelbess. Opersors ar gh bee thins = Peep f= ~~ ZZ a &= 5) Dthwise a perador | Bite speitons ire CH pre orhy to sctting chiding ftw Ge acetyl bilgi hy le pr euore . white " corregpond to tee Char and int dake Zep es and _vayianh. Bidwolse _ operctmlg ere. tye for _maalpdleding —_ fue_jnfegey obi feel. The binary ceprencliepow of dba inde gets alterre) as per joe. ype ob dinary Op brecbor applied. / ver- l A Ze, DER, ‘ + C Scanned with OKEN Scanner ai “ 4 Aypectal aperadtys tre | HF welode — eapoukee uA eA ae he | ote include 4 fonto:W >. eee mein) " [ op 442 "Syn 2 2405 Get¢heC Ys 4] H include 4 tostream > HT Include & conto. S vata marr } f Aibil: Coot4z" Enter 1.430 mbers!! Wo >> as hs 2 & +h 22" PA SumiXee; cede 0); C Scanned with OKEN Scanner ft thelude. 4 fosrtanu. b> AE include 0 now > void _mafn.() j tnd on Atk.) apr ZZ" Entry aumber's pynipen while Cn 20) } duck = Fath *n 3 7“ cout <2" daptorigh = 2efath; Bole t act hl) 4 iS Fibonacey Covred Arinilude Z sostrans.- > HE Iclode COMO: US yold marl) fad nol, por, 03} 4 ho l= D5 nord =z bs coutZZ no! £42" "44 no23 a : dor (ticod, iZs 3; T+) en é ; ae 03 = nol + nor} Cot 42 pio. j- nol = no 20 no~ = nog ; C Scanned with OKEN Scanner m ccbove_ duncttens and cH _ having. spe fal. Ars he. nero and delete fr _pertor Man sume dask, . ; beat | peu —eperacor A new pperator 1s pase ste orca te - di oberty cae then due objert 1s sreakd using nec soperidorm den dre obiech ects coll we expltitly se delele pperator to dele de. ae. object. therfore. we Can sau Hane IWedtme «04 obietes it pork 7 we lattel dp thre blotke structure ot Pe DYOGYGLIVA:. * ToT Syntax: Pointe -verviable ‘= new date d4pe y example: Pde * ps p= nev tind 3 - oR ink ee PP = new Int: . ‘ n Dele operadoy !-_ pelede operator ls ved mw delete aAaAaEzE eee He object (where _memonw 3 _no_longer ¢ o reguirta Mur th needy do be deallotatea?d so rod fue nemo, car be wed dor anodie spurpos es SyAduy delete _polnier yanable ric dzléfe Pp : C Scanned with OKEN Scanner __ PE A latoxs ' functor. spect: 4 re waLonj under vikaes serene La new /ine, end Wt- Ths VW sed dp wnserd 2 — TESST ——_ wifi ond ! o>. —] i] cuttnapl— ena! out 22 "nesp "Zeend 13 cour ZZ" Bhandp "3 Couvk 22 ‘nesp 7 cook 44" Bhan dip B vat Nesp 4 Bop _L hance 2 Le n esp Bhandp Of? ~ nesp Rha A Advp Nesp Bhanden — ofp Z| end st) J inserts pv ll pharacter i wtdtrour ends ctf ened 5 | aR cour <2" Nepp "Lhends 3 CopPeZ “Bhandup’ ‘ coo £2" Bands “ rz ‘ ee | | | = C Scanned with OKEN Scanner Hoen supe Fupttin yd ee i i eee | oo: 5 + y ? i i ‘ all a _axemnpler L a ae - | aa | emee . if . : i { Lo omtetes iva Mal int voll no, i chor name Pres | Pte ft perten tece : Y Io | | avbNC ' ; | woid Gtk 0): tid Js cola, ( }s cs | %, J es i: es ~ 4 A C Scanned with OKEN Scanner Al Object * Objeck Is Or njlance ot a class «opie Ip vaviable. oF digpe class, Objet ik phy strat dype of aby hin 1 create object fle momong ” IS -gllaaled br crt. member and Auimbey FoncHor » Ong a rlass. | Syndtix: class name ob} name $ LxGyople:- ePtoden+ § 3 s ‘ dd we nund- dy mate om tiple objtth fren et an wy lhe “nw! Hole obyechs seperaltd ipjdtr\s', class name obj! , Obf 2, ohy Zi ae _ Studind _§, SS), f25 Al Accessing cht member _ ona “pmb ‘dunchonw wd class . “o__acren ata mabers and member donclp.r _ ot class , dbjed of a class along wit e “Apl- operator bs Weel» yale qo Aeceys member fonitfir: s Objertname, + fonction () 5 xcs) :- S: cet () 5 wi Ss display C)s Pod C Scanned with OKEN Scanner Bape ddd ss a-gek 6)3 U s+ dsphy L): gti is: oR Delete «2 rlats shabend- gree dada member rol), panne. alates = and. _pertintege . Ritepi andl asp lay d. AE jclude 2 ostream b> Ht fnclude Aontoh \ class sydint f Ce putvate ‘- in-+ vo}! no char name £20] 2 dloat pertendue 5 7 v fuplic: - yold _ged- () wi £ four 42 "Enter Rollno"s tthe >> yoll nos couk 24" Enby nares él > “yame"? Cot 22" Ey doy poertendag € 3 tne >> pirendnge : 7 ws % 7 vold dr. play {i de cour £2" Ro})noz” 22 wi py Zend |} C Scanned with OKEN Scanner ‘ wz endl! ee AL ne nd] t ‘ 4 y coud Zé nant on pponealeay @ LOM | cou! ces pecendege _|_{—____—_ a | dyser 0)4 : . stvotnd 63 waged bp : 5 abyplay CMs ___— — : —— ay eS pe Tole main ( _ _ = — —— ne - etch 4 — at! i i C Scanned with OKEN Scanner Pritvate ? thar pv. name [20] 2 jot ¢ — Id 4 Ploat ¢ Salary 3 pode + 7 wid act L) J cont £2 "Entity e -parne "i Cin, >> e-name } Couk 24" Epter c= id “2 tn S27 erid) cour 22" fnhy ¢€ ~salary Pra 27 salary | wid Aisplay C) U i wrkéé"e. nM, =" 24 e-naMe 22 pf); put 2b "eI: "42-0 7d ZZ end] yn i tout 22" p= silony "eee | 7 C Scanned with OKEN Scanner = shape fo: wid main () Z clrsey (): emplt yee ¢: C: Get ()3 af é display ‘ay getrhl): J y C Scanned with OKEN Scanner