ebook img

Introduction to Programming Languages: Programming in C, C++ Scheme, Prolog, C# and SOA PDF

465 Pages·2016·24.684 MB·
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Introduction to Programming Languages: Programming in C, C++ Scheme, Prolog, C# and SOA

IntrodtuoPc rtoigorna mLmainnggu ages ProgramimnCi ,Cn +g+S ,c hePmreo,l Co#ga,,n S dO A FiftEhd ition YinoCnhge n ArizSotnaUatn ei versity KenHduanltl publishingc ompany Coviemra cgorteue soyf S©h ustttoeIcrnk Uc,s. eu dn dleirc ense. Hunt Kendall publis�ing company www.k enldha.uclnotm Senadlli nqutior:i es 405W0e smta rDkr ive DubuIqAu5 e2,0 04-1840 Copy©r i2g0h02t30,02 60,12 20,1b 5yY inoCnhgea nnW de i-TTseaki 201b7yK endHaulnPltu bliCsohmipnagn y ISB9N7 8-1-5249-1699-2 Alrli grhetsse Nrovp eaodrft.th piusb limcaabyte ri eopnr oduced, stoiraner de trsiyesvtoaertlmr ,a nsimanin tfoytr emod rb, ya nmye ans, electmreocnhiacpn,hi octaolc,ro epcyoirondrogi t,nh ge,r wise, withtohpuert iw orri ptetremni osfts hcieoo pny orwingehrt. Publiitns hhUeen di Stteadot Afe mse rica TablCeo notfe nts Prefac.e ....................................................x..1 ....................................................................................... Chap1t eBra sPirci ncoifPp rloegsr amLmainnggu. a.g.e.s. .............1. ................................................. 1.1I ntro.d.u.c.t.i.o.n. ........................2. ........................................................................................... 1.1.P1r ogracmomnicnaegnp pdta sr adigms 2 1.1.P2r ogprearmfo rmaannfedca et uorfpe rso gralmamnignuga ges 3 1.1.D3e veloopfpm reongtr almamnignuga ges 4 1.2S trucotfpu rroegsr almamnignu.ga. g.e.s. .................8. ............................................................ 1.2.L1e xisctarlu cture 8 1.2.S2y ntsatcrtuicct ure 9 1.2.C3o ntesxttruuaclt ure 9 1.2.S4e masnttriucc ture 9 1.2.B5N Fn otation 9 1.2.S6y ntgarxap h 11 1.3D attay paenstd y cphee c.k.i.n.g. ...................1.2. .................................................................... 1..31 D attay paenstd y epqeu ivalence 13 1..32 T ypceh ecaknitdny gcp eo nversion 13 1..33 O rthogonality 14 1.4P rogprraomc easnspdir negp ro.c.e.s.s.i.n.g. .............1.6. ......................................................... 1. 41. Interpraentcdao tmipoinl ation 16 1.4.P2r eprocmeascasrnioidn n gl:i ning 18 *1 .5P rogdreavme lo.p.m.e.n.t. .....................2.3. ............................................................................. 1..51 P rogdreavme lopprmoecnets s 23 1..52 P rogtreasmt ing 24 1.5.C3o rrecptrnoeosfs 27 1.6S umm.a.r.y. ............................2.9. ............................................................................................ 17. Homeworpkr oagnrda emxmeirn.cg.i .s.e.s. ..............3.1. ........................................................ Chap2t eTrh Iem perPartoigvrea mLmainnggu aCg/eCs+.,+. ...........3.9 ........................................... 2.1G ettsitnagwr itCteIhdC .+.+. ......................4.0. ....................................................................... CIC++ 2.1.W1r iytoeufi rr st program 40 2.1.B2a siincpa unotdu tfupnuctt ions 41 2.1.F3o rmaitntpaeundotd u tfpuuntc tions 42 2.2C ontsrtorlu citCnuI rC.e+.s+. ......................4.4. ...................................................................... 2.2.O1p eraatntodhr oesr doefer v aluation 44 111 2.2.B2a ssiecl escttriuo(cnit fu-rteahsne tdnh c-eoe nldsieet xiporneasls io4n5) 2.2.M3u ltsieplleesc ttriuocnt ure (switch) 46 2.2.I4t ersattriuocnt ures a(nwdh ifolre), do-while,4 9 2.3D ataanb da sdiactt yap ieCnsI C.+.+. ..................5.1. .............................................................. 2..31 D eclaorfva atriioaannb fudln ecst ions 51 2.3.2 ruSlceo pe 52 2.3.B3a sdiactt yap es 53 2.4C omple.x. .t.y.p.e.s. .....................5.6. ...................................................................................... 2.4.A1r ray 56 2.4.P2o inter 58 2.4.S3t ring 60 2. .44 C onstants 69 2.4.E5n umertaytpieo n 70 2.5C ompoduanttdya p. e.s. .......................7.3. ............................................................................... 25.. 1Strutcytpauenrpseda ddings 73 2.5.U2n ion 75 2.5.A3r roafsy t ruucstiusnrtgeam ste imcoa rlyl ocation 77 2.5.L4i nlkieusdst id nygn ammeimcoa rlyl ocation 80 2.5.D5o ublliynl kiesdt 84 2.5.S6t ack 86 2.6S tanidnaparundotd u tfipluetas,nfi, dl oep era.t.i.o.n.s. .........8.9. .......................................... 2.6.B1a sciocn coeffp italsne fidsl oep erations 89 2.6.F2io lpee raitCni ons 90 2.6.F3l uosphe raCt ion in 95 27. Funcatnipdoa nrsa mpeatse.sr.i .n.g. .................9.7. ................................................................. 2.8R ecursstirvueac ntadup rpelsi .c.a.t.i.o.n.s. ............1.0.1. ......................................................... 28.. 1L oospt ruvcetrursreuecssu srtsriuvcet ures 101 2.8.T2hfa en tastaibcs-taforpuaprcr otof wa rcihrt eicnugfur nscitvieo ns 102 2.8.H3a nTooiw ers 103 2.8.I4n sesrotritoinn g 106 2.8.M5e rsgoer t algorithm 108 2.8.Q6u iscokar ltg orithm 110 2.78 .T roepee rations 110 2.8.G8r acyo dgee neration 114 2.9M odudleasr.i .g.n. ........................1.1.6. ................................................................................... 2.1C0a sSet udy:A lPTluo tgte.it.nh.ge. r. ................1.1.8. .............................................................. iv 2.1S1u mm.a.r.y. ...................................1..2..5.. ............................................. .................................. 2.1H2o mewporrokg,r aemxmeirncagin pdsr eosj.,e. c.t.s. ..........1.2.7. ........................................... Chpate3r ThOeb ject-OrPireongtreadmL mainnggu,C a +g.+e. ...........1.4.7. ................................... 3. 1A l opnrgo gerxaamm apq lueea:un eadp rioqruiewturyei itCnt+ e.+n. .....1.4.8. ................. 3. 2 Cladsesfi naintcdio omnp o.s.i.t.i.o.n. ...............1.5.1. .............................................................. 3.2.C1l adsesfi nition 151 3. 2.S2c orpees oloupteiroant or 152 3.2.O3b jefrcotmacs l ass 153 3.2.D4e finiotfci oonns tarnuddce tsotrr uctor 153 3. 3M emomrayn ageamngedan rtbc aoglel .e.c.t.i.o.n. ..........1.5.4. ............................................... 3. .31 S tagtliocvb:aa rli aanbsdlt ealsto icvcaa lr iables 155 3. .32 R untsitmafoecr lk o cvaalr iables 156 3. .33 H eadpy:n ammeimcoa rlyl ocation 159 3. .34 S coapnegd a rbcaoglel ection 159 3. .35 M emolreyda ekt ection 164 3. 4I nher.i.t.a.n.c.e. .......................1.7.1. ........................................................................................ 3.4.C1l acsosn taainnidmn ehnetr itance 171 3.4.I2n heraintvdai nrfuctneuc atli on 174 3.4.I3n herainthdai necrea rchy 177 3.4.I4n heraintpdao nlcyem orphism 191 3.4.P5o lymoarnptdhy icpsheme cking 193 3.4.P6o lymoarnpldha ibtsiemn ding 194 3.4.T7y pCea stiinCn +g+ 194 3.5F uncatniOdop ne rOavteorrl .o.a.d.i.n.g. .............1.9.6. ........................................................... 3. .51 F uncotvieornl oading 196 3.5.O2p eroavteorrl oading 197 3.6F iOlpee raitCni+ o.+n. s. ......................2.0.3. .......................................................................... 3.6.F1io lbej aencodtp se raitCni+ o+n s 203 3. 6.I2g noopreer iaCnt+ i+o n 208 37. ExcepHtainod.nl. i.n.g. .....................2.0.9. .............................................................................. 3.8C asSet uPduyt:At liTlno gg e.t.h.e.r. ................2.1.3. .............................................................. 3.8.O1r ganiozfta hpteri oognr am 213 3.8.H2e afidleers 214 3.8.S3o ufir1cees 216 *.39 P araclolmeplua tnmidun lgt it.h.r.e.a.d.i.n.g. ..........2.2.4. ........................................................ 3. 9l. B asciocn ciepnpa trsac lolmeplua tnmidun lgt ithreading 224 V 3.9.G2e neferaitcui rCne+ s+ 224 3.9.C3a sSet uIdmyp:l ementingi Cnm+ u+l tithreadin2g2 6 3. 10S umm.a.r.y. ..........................2.3.0. ........................................................................................... 3.11 Homewporrokg,r aemxmeirnacgni pdsr eosj.,e. c.t.s. ..........2.3.1. ........................................... Chap4t eTrh Feu nctPiroongarla mmingS cLhaen.mg.eu. a.g.e.,. .......2.4.1. ...................................... 4.1F roimm perpartoigvreat mofm uinncgtp iroongarla. m.m.i.n.g. ......2.4.2. ............................... 4.2P renfioxt a.t.i.o.n. ........................2.4.4. .................................................................................... 4.3B asSicch etmeer mi.n.o.l.o.g.y. .................2.4.6. ..................................................................... 4.4B asSicch edmaett yap aenfusdn ct.i.o.n.s. ..............2.4.9. ....................................................... 4.4.N1u mbteyrp es 249 4.4.B2o olean 250 4.4.C3h aracter 251 4.4.S4t ring 252 4.4.S5y mbol 252 4.4.P6a ir 252 4.4.L7i st 254 4.4.A8p pliocfQa utoitoens 255 4.4.D9e finiotfpi roonc eadnpudrr oec etdyupree 256 4.4.I1n0p uta/nonduo tnpfuuntc fetaitounraels 258 *4.L5a mbda-.c.a.l.c.u.l.u.s. ...................2.6.0. ................................................................................. 4.5.L1a mbda-expressions 260 4.5.A2- proacnepdda urraems ectoepre 261 4.5.R3e ducrtuiloens 261 4.6D efiynoeuS rc hepmreo ceadnumdra ec.sr. o.s. .............2.6.2. ................................................. 4.6.U1n napmreodc edures 263 4.6.N2a mepdr ocedures 263 4.6.S3c oopfve asr iaanbpdlr eosc edures 263 4.6.L4e t-afonrudmn napmreodc edures 265 4.6.M5a cros 266 4.6.C6o mpaanrcdeo ntrasta nifudmn pcetripaortnoiagvlre ap mamriandgi g2m6s8 47. Recurpsriovcee. d.u.r.e.s. ....................2.7.0. ............................................................................ 4.8D efirneec uprrsoicveeod ndu artteyasp . e.s. ...............2.7.2. ................................................... 4.8.N1u mbmearn ipulations 272 4.8.C2h araancsdtt errmi anngi pulations 276 4.8.Li3sm ta nipulations 277 4.9H igherf-uonrc.dt.ei.ro. n.s. ...................2.7.9. ........................................................................... Vl 4.9.M1a pping 280 4.9.R2e duction 283 4.9.F3i ltering 284 4.9.A4p pliocffia lttieoirnqni u nelgra yn guages 286 4.1S0u mm.a.r.y. ..........................2.8.7. ........................................................................................... 4.1H1o mework, perxoegrracanipmdsrm eoisjn,eg c ts ..........2.8.9. ................................................ Chap5t eTrh Leo gPirco gramLmainngguP argoe.l,o. g. ............2.99. ................................................. 5. 1B asciocn coelfp otgpsir co graimPnmr lioon. gg. ..............2.9.9. ............................................. 5.1.P1r oblaosgics 300 5.1.S2t rucotfPu rlroofae gcs t rsu,la engsdo, a ls 302 5.2T hPer oelxoegc muotdi.eo.ln. ....................3.0.3. .................................................................... 5.2.U1n ificoafatg iooanl 303 5.2.E2x amopfsl eea rtchhrionadug ag tha base 305 5.3A rithompeetriaactn didao tnasqb uaes.re.i .e.s. ............3.0.6.. ................................................. 5. .31 A rithompeetriaactn biduo inlfstu -nicnt ions 30 6 5 ..23C ombiningq udeawrtiiaatebrhsai steho mpeetriact ions 308 5. 4 Prloofu gn ctainordne sc urrus.li.ev.se. ................3.1.0. ........................................................... 5.4.Pla rampeatsesirinP n rgo log 310 5.4.F2a cteoxraimapll e 311 5.4.F3i bonnuamcbceeixr asm ple 311 5.4.H4a nTooiw ers 312 5.4.G5r ampohd aenlpd r ocessing 313 5.4.M6a rpe presaenncdto altoiroinn g 314 5. 5 Liasntld i msatn ipu.l.a.t.i.o.n. .................3.1.6. ....................................................................... 55.. 1D efiniotfpi aoianrnl sdi sts 316 5.5.P2as iirm plirfiuclaetsi on 317 5.5.L3im setm bearnsodhp iepr ations 318 5.5.K4n appsraocbkl em 321 5.5.Q5u iscokr t 322 5. 6F locwo nsttrroul.c .t.u.r.e.s. ..................3.2.3. .......................................................................... 5.l6 .Cut 324 5.6.F2a il 327 5. 6.R3e peat 328 *5.P7r oalpopgl iicsnae tmiaoWnnet .bi. c. .................3.3.0. ........................................................... 5.8S umm.a.ry. ...........................3.3.1. ........................................................................................... 5.9 Homework, praongpdrr aomj.me.ic.nt.gs. .e.x.e.r.c.i.s.e.s.,3. 3.3. ........................................... vii Chap6t eFru ndameonftt haSele sr vice-COormipeuntPtiaenrdga d.i.g.m. ......3.4.1. ....................... 6.1I ntrotdoCu #c. t.i.o.n. ......................3.4.1. ................................................................................ 6.1.G1e ttsitnawgri tCte#hda nVdi sSutauld io 341 6.1.C2o mpabreitswoCen+e a+nn Cd# 343 6.1.Na3 m espaantcdheu ess idnigr ectives 343 6.1.T4hq eu eeuxea mipCnl# e 345 6.1.C5l aasnosdb jieCnc# t 346 6.1.P6a rampeatsesbriysrn :eg fe rweintrchefe & out 349 6.1.B7a scel aasnscdeo sn structors 350 6.1.C8o nstrduecsttroaurngc,dat robrca,og lel ection 350 6.1.P9o initCne# r s 351 6.1.C1#u0 n itfiyespdye s tem 352 6.1.F1u1r tthoepiriCn c# s 353 6.2S ervicec-oomrpiupetanirtnaeg.dd .i .g.m. ...............3.5.3. ........................................................ 6.2.Bla sciocn caenptdte sr minologies 353 6.2.W2e bs ervdiecveesl opment 355 6.2.S3e rvices-yosretineegmni tneede ring 356 6.2.W4e bs ervainecdne asb tleicnhgn ologies 357 6.3* Serpvriocveip dreorgsr:aw memsbie nrgvi inCc# .e .s. ...........3.5.8. ..................................... 6.3.Clr eaatw iensbge rpvriocjee ct 359 6.3.W2r ittihsneeg r cvliacses 360 6.3.L3a unacnahdc cyeoswuser sb e rvices 361 6.3.A4u tomagteincearalWa lStyDi fiLnl ge 363 6.4P ubliasnshdei anrgwc ehsbie nrgv uisciUenDsgD . I. ............3.6.5. ........................................ 6.4.U1D DfiIl e 365 6.4.e2b XML 367 6.4.A3dh orce gilsitsrtys 368 6.5B uiladpipnlgi ucsaitAniSgoP n..sN. e.t. ................3.6.8. ......................................................... 6.5.C1r eaytoiounwrgwn e bbr owser 368 6.5.C2r eaatW iinngd aopwpsl ipcraotijiAneoS cnPt . Net 369 6.5.D3e velaow peibnsagip tpel itcoca otnisowunems bee rvices 374 6.6S ilvearnPldhi ogAnhpetp licDaetvieolno.sp. m.e.n.t. .........3.7.7. ........................................... 6.6.S1i lveArplpilgihcta tions 37 7 6.6.D2e velWoipnidnPoghw osAn pepU ss iSnigl verlight 380 6.7C locuodm puatnbidin dgga ptrao ce.s.s.i.n.g. ............3.8.9. .................................................... 6.7.C1l ocuodm puting 389 6.7.B2id ga ta 392 Vlll 6.8S umm.a.r.y. ..........................3.9.4. ........................................................................................... 6.9H omewporrokg,r aemxmeirnacgni pdsr eosj.,e. c.t.s. ..........3.9.5. ........................................... AppenAd Biaxs Ciocm puAtrecrh tiutreaecnsAd s semLbalnyg uPargoeg ram.m.i.n.g. .4.0.1. ........... A.l Basciocm pcuotmepro annecdno tmsp aurtcehri .t.e.c.t.u.r.e.s. ....4.0.1. .................................. A.2C ompuatrecrh itaenacdst suerpmerbsol gyr a.m.m.i.n.g. ........4.0.2. ........................................ A.3S ubroauntldio ncveaaslr ioansb tlae.cs.k . ................4.0.7. ..................................................... AppenBd Pirxo gramEmnivnigr onSmueponprttsCi ,nC g+ +S,c heamnePd,r o.l.o.g. ..4.0.9. ............ Bl. Introtdooup cetrisaoytnsi t.ne.gm. s. .................4.0.9. .............................................................. CIC++ B.2I ntrotdUoun citaxin odn prograemnmviinrgo. n.m.e.n.t.s. ....4.1.2. ............................. B.2.U1n iaxnL di noupxe rsaytsitnegm s 412 B.2.U2n isxh ealncldo mmands 413 B.2.U3n isxy sctaelml s 417 B.2.G4e ttsitnawgri tGteNhdU G CCu ndtehUren ioxp ersaytsitnegm 419 CIC++ B.2.D5e bugygoiunrg progirGnaN mCsG CC 421 B.2.F6r equuesneGtCdlC cy o mpoiplteiro ns 424 CIC++ B.2.7 operators 424 B.2.D8o wnlporaodg radmemvienlgoe pnmveinrtoa nnmtdeu nttosr ials4 26 BJ Getting startepdr owgirtaehmn mvViiinrsg.ou .na.ml.e .nS.tt. u.d.i.o4. .2.6. ........................... CIC++ B.3C.r1e aat inpgr oijVnei cstSu tauld io 427 CIC++ B..32 D ebugygoiunrg progirVnai mssu al Studio 429 B.4P rogramming environments. .s.u.p.p.o.r.t.i.n4.g3 .0.S .c.h.e.m.e. .p.r.o.g.r.a.m.m.i.n.g. ......... B.4.G1e ttsitnawgri tDterhdR acket 430 B.4.D2o wnlDoraRda pcrkoegtr aemnmviinrgo nment 431 B.5P rogramming enviPrroonplmroeogng trsa. m.sm.ui.pn.pg.o .r.t.i.n.4g.3 .2. ............................ B.5.G1e ttsitnawgri tttehhdGe N UP roelnovgi ronment 432 B.5.G2e ttsitnawgri tPtehrd o plroogg ramming 433 B.5.D3o wnlPoraodpl roogg radmemvienlgot pomoelnst 435 AppenCd AiSxC ICIh araTcatbe.lr.e . .......................4.3.7. ...................................................................... Bibliography ............................4.3.9. ............................................................................................................ Index ....................................4.4.3. .................................................................................................... ix

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.