PPL Akash

You might also like

Download as pdf
Download as pdf
You are on page 1of 44
PROGRAMMING LANGUAGE (CSE204-F) ‘Cass Work = 50 yams = 100 ‘etal 150 ration of Bram + 31 uct owl beset from alte for tions nunca ope oogonia fronsk ‘ihc hae ae fs comma guertion hh aerate Tharodentr tants Ce tom gun rh eh Staton ate 9gorion: SECTIONA: Introduction ‘Proranmig langhtee, Cherseorstin ofa good Sree sd seme PropammingIngangetenlotarscomplar & atrpetery eer ese: Br cjets vale & constant, data fe, Speieaton & arent oe Peccnay at gps Dears trp cheching& type conversions, ‘2bmen tila Nemaredis pes enuteraons, Beceans chars ‘SECTIONS: Structured data obec Subprograms ‘and Programmer Defined Data Type Sacred data ject ats typ, speiention & implementation of erature ata tsps, Deaton type secon of ans ercare verted rays recone Charter ‘Rings vara sive dats structures, Unie, pontr& programmer defined data oes ofc Evolution of data type concept ncaptlation & information Biine ‘Spree, type cefiiiny, aura dats type SECTION C: Sequence Contrland Data Control syetace and semantic res ef 2 Ip epi que eto seq nr witness, couse sitet, Subpegiomsqunecotel- so clr, are eo Erpton & expt hander co ranes, eqence nual: Names 8 ree fevromon ae dyeamic pe, Bek Str, Lc dat a etek “romen: tre Gta nice uae Parr partner seo ‘chm. ‘SECTIOND: Storage Management, Programming languages Maju tin oe rpeing vag gran nda contalled et ‘management phase, tate rage manages, Stack bse stage aneeee epg mtngeont ae & fd aw conn nai Fee oneal troctaed uneons! aad set enented programming AE spun of Ci Cr pogameignguge mt PORTERS END TERM EXAMINATION 2018, EIGHT SEMESTER [B.TECH] PRINCIPLES OF PROGRAMMING LANGUAGES (eres.424) Timer 3 Hours Man75 Note: Attempt five questions in all factading Qno. 1 whieh Is compalsory. Selec une question fom euch unit @ Atempt al (G1. (a) Explain Formal Translation Models? © ‘Ans. Translation dls under he flowing subheadings: BNF Gramimars {Osho thse 1.Grammars:A gmt dfod comply by 3 Gite ste ands ear eye ‘Mathemataly we ay repent rama flows [ath TF where Nis hese cfaon-terminaleymbi Tis the ae of terial embels: Ps the set of production cule that ultzately connect expresins with nontrminaleymbas ts expressions wth ermal seer Zis the tart spel wach hat eM, From the above deities the flowing comin ave normaly apne Brinnand Naa Tite ie NT = sino fagrniar compete rnin! and onermina eel, 1 Telngaags ofthe grammar isthe sett laceplale strings fr ha grammar 2 Syutan Trees: A syntax wee (ned called derivation trea) in a aphid ‘procenation wed oillsrate the derivation ot sentntl orm oe ates Example: Figure shows hw wemay ue a denen smctzamol Fes tio tee toahow that 2 sa valid GRR] Synta Tes oS tt ean oa Gmmar GO Ambigulty: ftw more derivation reer x ‘ranvmarG, then said tobeantigwous Toe uflctofenbipupiete ee eee hoe “ecu ght Some Pinole of Poramming Laas ean erwin ngs Se Proacie OER sade tenth tole se hebtnee Medhrtoieg Tapnaora matics MN near banded machines (tsi teste mtn uw Eapleshetermfubmerbioandietree | gy oe ee eS fu ponegrts bean in mare thar one orm, Ase mono eT eine eater, monn Sicrat targa AD chit ferent earn ifereotsitontions, Tis greg 2 Fepmrphee ie conde on ofthe inportant fentre ef Ode Ofsted Pavan Types of Polymorphism geet ac te ripe Time Pelymorphom: When the reairship ete oot cor ccs un ther acon es detained daring the comping {Stnown es tomple ce plrmaren. This ye of almarptiom is lo known as BEET SSUES papcorstom Al th meade of oompletinepymerphion eceaederivohnd danas the comple ine “fou an izpleneat exnpie ine plrmerghion wing fonctin oeroaing apd pectic serlentiog Mchottcariononinig i an implementation of cme cecyolomurtin there te sae aa aa be aened to more tan one metho er FEnedon avg eferent oruset or satres td airs ern pe Tantime Polymorphism: restsce pears, the compiler resales th bjt st ran ine tothe cic wich facto al hold be ante with Aaveaject Ii ado kaows so dyno inte Undingpemorphem, Ts pe of Folroorhisn i eneaed trek nil facto and fein vereding. Ath eet ef tie palmrglen gt ovked rng th on ime Nee rin ian ppc er ine oi har omit SPSETiae freer: Tar elt b's earn ove eneaton rae a Eimplctineprvmorplom nce all be methods that ned to be executed are cal ering run ine “The tleentaton une polyrpin can be achieved into may: + Pascan wecding + Vital fncons 11. (e) Whats a Thread Explain the wn of Tread in Synchronization. ‘Ane Thread: Within » program, ved is a separate exeution pat. 16 ¢ ‘ihe process hat the peratig stem ca eel and ran concurrently Mi ‘ther threds Toe operating stem cress and manages thread and they sare fame meso and enue be progam that ested tam, Thi eoables ul* {ireds toclaborate od work efSenty win angle program ‘Use of Thread: When you reat code tha shea ste bt stil Benede sharing data or esources btn reds, the mos pata espet of progr ‘comes he sbiity to pynchronne ends ela on a aon rite nt "sunt nie he na. Whos wt ‘te SLs employed ta repesent the ‘Srinaie Ateomting hte remarcnns ere wig src “Type yrchrnieg tw trends nf ane meresyacroston ote uaa a terre Sevanere naomi tena “ee sitters ro i romewaitinmierntewtntan ee sn Jnoguee the ica ofesngs prion afer omen me caer sof Phi Tanda mean ie artery Boigu taereeteraa oa Saute “hse me ro vom nee aay “cura reweginonene ae _ Roane Fe ee ArT am Ronit een sn Ot Re i enn ‘yochonzatin primitive in ore of leas to most ent Driven: Prsramning wih estes and steno of asynchronous "FlowDriven: Pegrammiag processes proleined shanna, Proves communicating with each other over { Losi: Programming by peciing a sto fact and rules 1 Sonstrain: Programming by specing a et teenie {ups Oriented: rramniog esting cea applied trenpaenty Reflective: Porat by manipulating the progr ements rays Programing with power arty oertors GL Explain the concep of operator eveloading? o nntnyeheraerovrloading Opritacenisacompletinepaynaphise ssid meaning to an exsing operator Cos withect chering som ut ras tna pees aloe aaa a ne sec as aly. ‘dase Catone . nt mano cia Some ‘ee empl weber aa" 8A fies Hee ane a eM eco ons a, which re of seeded ype be perigee et a aloe, bee the a re Sone ea ray tne Rhein deere ee er anarer Taser tn ero Oper tion come re eens nah pra alt eth a er an re reer ht tas vo ha ee i serine ert na ong Oe nt enchant Reig cea re ol main, ee sane ei mais tg wnthe xt es si a P 22:19 Detn the terme ents antes and pragmatlee, s san naman ass ec rales tht geen trots end erangoent ef keyword yy, i ether element, Syota dts seated se neers thoes ony oe ah Siar asucrco Oe peri or Tre is yay li ed eet ow the res 200 syns tan tasoansthng inthe meaning be sete Se ee ‘Stent aro perm as en wee a ‘Sipe mumps of gn crn ming seis in Cv, said ied hh on eran sey ScmantienSemanie festa aneeted ine ete and he she ae na perening gs Hes ses bp ee ered hie tte engraver 1D, Ualvrnity1B Tec -Abaa Bos sa20-7 Semantic erors are enmunterd and handled dari runtime of he posse xcs If hee ny tomas eer and even hon fe sntmet Bas erect SFSET ldo ptr te fnctan at sisted fora Tos, rchern ECs ort the pre at oe tn td poe ‘Qz:()Eepainin brief the statement evel contro stractore. (65) ‘Row Conta Structure re us nyt pay ow ected in pore day Ueno pogo cone nore er tendered esed ‘Suhel og ar ool retary susan std hes ach ‘Erectus pea fous Wed cera prnane reste ‘Thre arte Bsc pe fie aw el kor = Wi Sequnetane er sopenta fom {By sles ops con tow {G terete peer rpeore a {2 Scqwentil Lagi Sequential ow) ‘Seven lea Se sae age lw sri or eguenal ow i ich ths fw depend onthe ter of tnrcnn pres te he Cpe Une see ‘sieucanarpen ho our ened ie ier nue, The ences tye en or mrane fuera! nee ey A, apy fly co inet motte ar writen st ofthe ocning cease copes pests el ‘ecm flowin ostay Bo patos {Selection Lore (Conditional low) cette lvsa mani ennsrruetewhihes oe nt of several wen mae Tastes wich ue ne Ge of a ant ‘Sow o Consol Sacer The incre conte five Spee ‘Sint ternative This sortie hasta are Tecan bina Bidet eractare| Dente Alteratne Tis strane haste for onset ae tail a Bina [difrecare) Satie Aermstives Tis tr Msi ten a ‘Meleal ef edn Bh then: toate) sei (onion the ‘Module 5-200 Bah Somoter, Preis of Programming Langunese ind festa) Inthe ways te fw of the progr depends on the set of eon niin Tic nn te me ndrstoe ythe lowing Now cha {€) tration Loic epetitive Flow) ‘he teaton one emplos a loop wich aves epeet statement alowed by a sed uno te odo on ‘The two type of hee strates ae Repeat-Por Structure: Ts strate bas he om: Repeat for = Ato Nby Bede Id fie? Here Ae the ntl valu, ie th nd value and ithe fncrement-Teloep ed Inhon Aci incense o derenes esting f the petve and negate vale oT Fevpetely. Repeat: While StructureItaleoueeacorton toontrel the lop This Repeat wil onion: ied {eodotbowp thn, there equres atomen tht inialiaes the condo conteling he loo, snd there ost ae bea sates nie the oda that wl change ti eondon Ieadiog tthe nde te np. ‘5 (a) What do you me that are by Binding and Binding time? Doseribe about various clases of biding ime. a8) “Anu The binding a a pragram sleet to a specie characters or property ‘the che a tne proper rn ae af oe properties. The tine doing program, ‘Spent a ponesing when this ce se mae is eined asthe iting tine ef ‘EN prvetfrthatexment There armless findings in programming IRogunges abi variety ong ines teenie oolve within the terre of nding Sn bog tne the props of program sloments hat ae constant her By the ‘eGstion othe language ors eection “Types of Binding Times ‘Thee arto types of binding ita which ara follows ~ Execution Tine (Run-Time) ~ Sane Bindings are implemented dus program extn. Thess contain ging ef variate othr ules, ond the bie [Tvarbles to specie storage areas. The oper of unio ining area flows = “On entry toa subprogram or block In some languages, bindings ae twappna nly at ibe ime erry oa aprogam or eck during exeition. At arbiteary points during execution ~ Same bindings can appear at any point dating tneexetion ofa program. An example isthe bare binding of variables “les hrogh assignment, whereas om languages such as LISP Salta, and ML ow the Lediog a ame io strage neton alee appear a aatrary poten the * Translationtime(compietime)~Therearthredierentypesoftunslatin time bindings eens lows = ~Bindiogs have been chosen by the programmer —In wring program. the programmer caiunly produces soe elonsconeeraing coe fvarabe Rae, LP, University B-Teht-Akash Books 2020-9 esr varie, preram sttoenttracaey, ee. hat describe Bindings doing ore ei fas ransatar cee te ttn ndgsta decd al Stace ft se code SDindinga chosen by the trandator~ Some bindings are sled by the langage ita witht iret pregarner rearement For eral, the aera a ce in oe Horie Segnsed raphael roay managed ‘het knoviedy or ntrventin by be propane “Stinaings choven bythe loader ~ A poceam general icides malt sutpregra at olde Combed nts ing exci program, The anlar {orl nas vss to addreces win the soaps nee reo spre. orgs hola stgnd aoa ddresen with pil cape at wl ington ie reer ‘@3. 0) plain the terms variable and expression with example.) ‘Ans. Variables ae ne en tsps memory ations in order to tre «ua in's promo, This data canbe knows or saknown based onthe aaignnet of ‘tht cai set tool mor than gneve. Th sole rps tone andre dain the memery aad ents ‘rable canbe acessed throughout the programe mbonever needed ‘General the variable mare eda a relrnc fo eer the stared vale seeing arabe: Thee eet Vara Th general the declaration consist e® pars the arable ye vacate Intel, andvemeaan tend the declaration nn wt Arable Ue, wari Syntax datatype variable name = value Forerample Invepet Expressions: An expression uaaly refers toa pao ofcde tha se tzpresone iy refers tape of ode that ean be evaluat ‘neytabe anda oma of warble eur fenton cl and he ‘mpeeeaine logue, cote espe of eres eet ant Expressions are. gearally formulated. ire an AE esol foaled rently in varius poem ‘Sclnts amenthe hover that an expression wil elvaye yield smtp ist single example ef erpecions In the example above, th at lS am {2Mretson, $55, wld the value True mite whe send expres nl ldthevte 8 St MH areere, the repeal thee difrent types of 10-2020 ‘ight Somer, Pines of Programming Langwags ‘A dase ig in ata Mandingo ating he coe eta Fr ena 2 sas Bape ea tnt eas Daa as ‘jetta ces enemy witheone ropa sad bhai. When ant is iano atin he cay lated’ Each ct ae so ‘eather Kae dash crs iterate ‘arcane Bostic bbl onme Pomerening Proper nesplatin: Easprltin in oop mean tence lls mptnt ‘nero ns pele deg alt te sete rain th ts Wisin ajo he tama on main the te one ‘henson sywangvormer fom the ATR mace te mane rece dour rue and evr na emmy Icons ot eons roped Siren me aplon hele inning tad method al ede obtain a dag ath tow amp tra woking he eh en “Ahtectio Rasaly sb re al he opts tnd Spas cot ent ration rt irene settle oto ented prograning en erect nr pdr bs he each Wine sittin fc oa nent wth actig sen, Ib eomplsiy rc bec of nga herteance Ian ea Skerng wees charac Jat ke so cer eres shat on yu prt sole tinh at and ithe fot ne sn toaster Canbinng tnd oering he Set nd tet ‘oper owt he tn snl pan charac fos "ihertace ep youd te partment steamed neo cs Adie le neurdany. olyerpinm: Pals sso hav te some fame of + mah eceming ere tae aroun ng ot has shops STibcaquere nent ei res of ectangiislengrieai Th the ait play th meng nore anv for: A pron cn ren ita een te i os ap ‘Data Binding: ining mess bn on thing tanto Har a OOP Binding fers toikng se nt hr ser oneln he Apo ‘hee ae two man ipso nding Sari indng Dynamic ing State Minding In sate nding the property af ene ojo is changed ety wienut ean te ots property. ‘Dynami indig oreere when the property of oe abject changes, and deo hi, tho property af another eet pts change [Mosage Passing Passing dala round the rogram isthe mest important feature ‘ofthe oop eonnp: Message passing is the sending of «message rors one object 0 baer How doe thi ora? 19, Uniesity coe -Akas Boks sno0-18 is wm specie res tht threo can we er i haeegenthe manage to hats esta data tps? Explain with to help of am exam? (© a wnat Bats tps ADT) cr pe lor eae fer bets whose behav 5 easly tele ads opanne Te edlin CAT ly metons Jedectotspecty bow data wil be organized im memory and what lgerithms wil Bese lmitetiog the oertona Te led “abs” beast goes 38 ‘ire proves of proving oly the etentials and hiding the details is known ax lee ‘The ur tata typos not nels know haw tht data ype inmlamente, ‘xampi weave bes ssing Pv aos ie atcha datatype nth ‘he fitowilge that thse data ype an operate ad bo prfrned on witty Wee Sot dr only niet ow what «dat type cam do tot baw wil ba ‘glerceted Thnk ot aT sen black bx which ies thinner structure snd design at ‘Hdta te, Sunwell tne thee ADTs mmey List ADT, Sack ADT, ewe ADT. sin Sch ADT inlonenttin ind data eng str in ach ad, the a Thegearumalnaten monary frhe data and adres pated [ ‘The head nde ad the data nas areencapmalaed nthe ADP ‘Te cling uncon cn ly th paar fot ac number etre caren ne * posi)~Tnvert an leet on end fhe tackled op. a bihlatlowove eer th deme tet oft si ‘Tt ~ Retr the comer the tp of he sack without sao seomay i ifesckisntenpge nw? SM Wath hes erat ac Return th umber elements athe tack. 1 sEnpo) fear rvs the tacks tty, tert rear fie © Ful) ~Retar a ifthe ack fl teen etna 5a) Espa the difernce between ype conversion and type coareon- (65) scitndie nroundaye Sof ae Setar i iteeres between pe torson a 122020 igh Semester, Prices of Prgrmmieg Languages 1. Cone on csi a i pee, bee peeves i tnd pored ty te propane pe omen poi psa stl net he overne rets are ope casey eed ts 1 Preity Typ crn an alin wep rls peed sec tpeened Fer Iype orn ead nore ea, [te peared Sa pe “Lon flare ype cern areal septa when ring os hh re {ts ope Tye concern en ae elt in ar af rm, Yu th propane ‘sere enol oor the poe sad ean take meatus prsave ey “Fei: Type coercion ited to predetnedrae,wheres ype cenverig allows or more Betty ener da es type conversion hve thir own strength and wean ‘Siete important o cw the appopeate ype conversion seed ‘edo the agri requirement andthe tater ft ata beg anit, (28) phn varius eve of OP in tora fn ‘Ans. inorance whenever the drive as nb fom he bse ets hen hha membe ef be pret dae an be seen the cl aoe crteted ‘yt vty ma By ea vay mad alway tpi ‘Syntae hss derived ass nee vat debe le ae t ‘Mie cote i “Types of Visbility Mode In Co ‘Ther art 3 types of ity ada in Co ha [ePrvate ity toe, 2 Pratected riliy mee, 4 Pobe satya Derived Gass [Derived Glass | —Devivea Ga Base Glass | Private lode | Protected Mode | Public Node ‘Private_[ Not Iaerd | — Not nberited | Wat inhered Protected] Private Prteced Protected Pubs Pere Prt Pablie 1. Privat visibility mode: When we inherit deriv dios em hw kaw das ith pene sty ode then the public and peat embers of the Be cas een private members af ho derived dle, 2 Protected visibility mode: When ne abet a erved eas from se ass rth protcedvisilty mide the preted and pubic mentee ofthe base dee ‘com protected members of the dered se 8Fublie visibility mode: Woen we inert decived lass om a base at with pacity mode, the pbc members ad protected seers eth are ass wil ‘einheriedas putin ersand protected members reserve ft derived la, 1, Univers B-Teh-Abach Bask sa20-13 a eee eee iin lar tee ery ried mo rw tack tnd a zoster tan heap Memory. N's ao Rowen as some tae acezuen Hae pesca eee eae sth deed te steal Whras naomi ones Remory allocation and devall =e ry. Te esr, andthe sot’ Keyword ot erord i urd i deallate Memory: Wah sac Yasue i Memory saat th inal cad a hen ‘ies reared tothe pine ana Allocate memory in Cre Syntax. ster arene data pe ‘The onterisefpeinter deta — ABP. The data type intogerpseharatr and an eine dving the exeetion fe Memory allocation sdf te alcation| of type Moat nt sting ete, ‘a0 newts {nt = new in) Desloate memory in Ce: 14-2020 Fight Sense, Principe of PrgramsingLangvans ‘Syntar: ete poiter variable; Example dice (Qe) What are wild pointers? ow are they ereated? Discuss the measures to handle them o "Ans Pinter store the momar address Wid pines reese rom piers i, they le stave the momaryaddrenee bot pot the nat memory or dla ‘rive which has bom dalla Such pce enous wid poltrs "Apoinier behaves lie wld painter when dedared bot oot inti THA ssh they pant any anda meer Toatin. snetampic of wl aster in Crs Innes, Finca nao sang ameepce intmais0 feria ns ieB ee) cout ceami ce" 7 turn , ona To -yBie01956927640 Tntimaboe prograapoisterari declared but at nile. Site delaying same ron memory leans ert in <8 i++) cout ecar 0, thi ean ony happen when Pl ashes te tat ‘ect and ells V operation on srnaphore ian ist 2 muta rsin is acbeve, Leck atthe blow image for dete wich s.so29 ‘Bight Somer Princes of Programing Langvarcs vey [GPE aa eee Geir” ren PEAS a 2a onsen he a fos os betnsAnmensrenymemrintetnne ‘etm mc ee SST SS perenne at en sft tremors iweeretrancrmanrares fein nanrs cot cnare ie aiecnceneetepenetecnereseeas een ore Excooecnercnanieeraanene ts ie Sone 1 versity B-Techl-Abash Rosks 2020-19 four conditions hold simultaneously Donic am arte fhe flowing souanry Conon (Noe rmtual Exclusion: Two or more resources are nan-shareable (Only one process canaeta toe) esd an Wai: Aprotes isang at ent one renurceand wating fer resures. i rcmption: A resoute eanndebo taken fom a process unless the Proms car WaltA xt processes ae waling fr each ther fn rela for. concept of 3 (90. () What is logic programming? Discuss the designing Logie Program. @ fan Lape Programming isons ofthe Compete Programming Parada which i eee toents expres te fc aod ales abow erent problems with 8 Peele! ot Her the ule are writen nthe form elepealclases, where ida uu ave pecet Por eamol, Head and BL BD, BS are the eerent of TED. Now itme tate that “His eo, when B1, B2, Ball ar rue’ taste a rule ‘Onthe her band, acs ar ike he ral bat witht anybody. So an expe fat Witatne Sm ogi programing language ik Datalgar ASP (Answer Set Programming) re known a prey declarative language. These languages allow statements about ‘Thee prorum shuld acampih There eno seh stp by tap instruction on Bow Tororo the task However other languages ike Pog, have declarative and also Imperative proprio Tie may aco ncade procedural statements ike “Te slve the robo perform B82 and BS ‘Sane oc peering languages are gvea below — {ALE aleerate loge enetonal programming angeag0. 1 ASP CAnower Set Progamming) Gye + Dialog + PayCLPs enon 1 Palog 1 Pree + RooP B.TECH (F-SCHEME) FOURTH SEMESTER MAY-2010 PROGRAMMING LANGUAGE (CSE-204-F) Time : 3 hrs. M.M. : 100 Note: (i) Attempt Five Questions in total, at least one question from each section. (ii) Questions No. Lis compulsory. (iii), Each question carries equal marks (20 marks) Q.1. (a) Define data object? ‘Ans. Data object refer to a run time douping of one or more places of data in a virtual computer, It may be considered as a container for data values, a place where data value may be stored and later retrieved. A data object is characterized by a set of attributes, the most important of which is data type. The attribute determine the number and types of values that the data object may contain and also determine the logical organisation of those values. ns am] (a) Data object (Allocation in computer ‘memory with namex) 1001 x{00000010007 (0) Data Value (c) Bound variable: (A bit pattern used (Data object bound used by the translater) to data value) Q.1. (6) Write Short note on need of translator? Ans. To execulete the program, We need programing in language processor. The process of converting the source code into object code so, that program can executed on machine is known as translation, Translation is done with the help of translator. Language translators are also called language processor. Main function of language translator 1, Language translators perform the translation of high level languages or assmbly language into machine language. 2, They check for syntax error that may present in the program being translated. [Source code]_—» [Translator] —>[Object Code| Q.1. (c) Whatis information hiding? ‘Ans. Information hiding is the term used for the control principle in the design of programming defined abstraction, Principle of information hiding is the hiding of design decisions in a computer program that are most likely to change thus protecting other parts of program from change if the design decision is changed. \ ‘The protection involves providing a stable Interface which shields the remainder of the program from the implementation. 2 Pourth Somes Programming Language, May 2010 Jnnadempogamnice ings netomat dg ltomate vay, an ehat esl tera oe rd he oeping ee moa oe Set itrnton Maing 1 nid the psa strgelyot rato tha ithe physi tag Iau hinge th cage ered oma eka see oe 2. Tomakea program cor rt tro undentan 3. Tomakepopam orale flees nguget nd machine, {Toate corse seety meres pain 5: Toma ice nary nl nea eile and tide everthing le Qua dotnet term pe teins? Ans Tp dion han rig east a Wher iat cs oe ADT sacl to anes el eee oe Sint rect nsependt ay arctan Du in anuage oh Pte a AD, mania fp defn sou dene sop nt date nie dase nan Spnincsntaaclact ene {QL wewhaticheepstorazemanageaent? ‘Anu le sed on hay date strstr hap seo ae srihnwtich peste ase isacreahnycscencedinnnes | Aeety Yori arpece of managing their “tet seny ar end ha aaa as when’ iangage pratt oe Bloated Sed Bef Pare a devine program erecting Tet ray agent he roca feats enh ecovery. compaction of ecare may be hewbloke Ecplated Heap tree aapent ‘Shige cvdd ice on eatrres 0; kip the nxt inetruction ‘Akash Books 5 tre thnow volun mamory where eu in handnaropeation “G2 0) Explain the conceptofeasigament and aitallzation? ‘Ron Assignment tthe asi operation for changing the binding of objet. Thin chang, however, ct ofthe operation An aasignment statement wf eer canes imperative languages to dnamialychangs the bing conection of values to variables. “the general syne of ep asineentattement sven as: “langotvarables> casignment.oprator cexpesson> bese implemented bya singe value toa data ae hmastet eee ad ace nite geen tee Ingman anignnt stent cnet Dna wnomettoreior(oa's) Oe The sgnnent prt ead vase otto rrtmatdnasiee Nee ttn hone ae to Menthe easngnenoetr cad vl whih fst Serene cee td carta eran op dela * Sanpan dene ein oprad raion E Concierto penn 5 Kastbespuc niet compere doe { Muraincanpd ace th rtf orn Intima at hasnt tot ied nut gernning ter pananl pagan sla tages tenet theese eer are afer the ns jt eds inal oe ioe f e epesceaogra iowhdnies dress The indng a eee oes te ae ound a agi ele ete ia sie ala iand ore Panga ete Scurteeruntne tenet name iss aes fats tira oh Ga oapiinincconepf oneas and characte ‘ts ar apap eile or peng tan fl, ent inine pr topo eprting read fe, uly Speciation he Ds da pe omit ef daa hc haing ono we ene an dt pe en Jentongr ined enumraian, an" Date dt ap i conidered simply a rae Bn = tte ah en te sient ase typed the na eon sprain on etn pe nia enn ptonsn Bae ne signee 6 Fourth Semester Programming Language, May 2010 and: Boolean x Doolesn-»Boean(Conjntien) ‘or Boolean x Boolean » Boca Gncsivedgjunstin) ‘ot Boole - Boolean nezation rempleent) Other Bostean operations woh x eqvaleees neusv,or pletion, and and)and nor ot oF ae cosets ade Trmplementaton Thesirce representation ira Bea ae let an bitoteterage proved na descriptor deypnating the datatype ie ected econ single Uismapnaltewperselyaddecaie amen oe erage epreentaln ‘stondod cob single sddresrableunit suchas byte or word “Aarti biti used for the value 0 = fase and est ofbytes or word get ignored ‘Characters! Most data re inp and outptin character fom, Conversion og | {Input and output to other data ype sully provided, bu preesting of some data liecly ncharacer form is loo raportant (a) Specification: A character data ype provides character ax hse value. The ot ponsible character Vluce ib usvely taken tobe a language defined ensmeratin| orerpondingosandard character et supprtedby hardvareand operating sya. ‘Tre orderingof the charactors inthiseharcer et called Uo ellatingsquenes | ‘huracter set Callting sequences inpertant bela itdeteranes the aiphabeta onder given to characte ting. Tmplementation: Por character valves, the ardware and operating syste enaracter ces sre used. The reason forthe chic spe (eh Ifthe hardware storage presentation are used then the ase operation oa data lof that types may be implemented using hardware provided operations ‘Qut (a) Write the Specification oftructured data (yper? ‘Anas Refer Qa) of May 200. Que @) Discuss declarations and type chackingof data structure, ‘pon Rdecaration in program rfertoa statement that information regarding the mains dnd ypc stacured dat object othe programing language tandator Ad aaa crore ther are mor tributes tobe speciied therefore strvctre nSenerally more comple than element dota objet, “Te declaration of ada structre eg aray provides th 1. Datatype is an aray 2. Number of dimensions 3: Suboeripts naming the rows and columns {C Number of omponents £5: Datatype ofeach components orenampleitwo declare nn array in Patel ‘Ararrny Ho 10,-5.5] roa thea * Data type is areay 1 ein? dimensional array Subweripts naming the rows are integer from 1 ‘naming naming ae intogersfom—5to5 4+ Total ne of components are 110, + data typeof eech components ea. flowing information: to 10 and the subse Akash Books 7 ‘type Checking: The basieconept of ype checking fr data strate are snilar to tee dacuotd for slementary data ejects however type checking i somewhat ‘Shoo dat stractres becouse smpenentaelecen operations must be taken nto "Two main problems in type checking frdata trcture are. I. Bxlstance ofa selected component The arguments toa election operation may boa righ pe, but the designated omponent may aot exist ithe data structure "The uni checng may berequized to deteraine whee heseected component nists ele the formula i used to determine es pres ale. 2 Type ofaselected componcal:A selection sequence may define complex path tovough dts structure tothe desired eompanent. However, icant bein general be Sour that the selected component exists when needed et run Cine (5: (a) What are Records Define specification and syntax of records. ‘Ans. Ther is requntly a need in programs to model collections of data that are rt homigencos orexample info about scale studeat might include name rll 30, [Records ae desiznated to meet this kindof need. ‘Specifieation: The record strctore wast intadcein COBOL and has ben ‘omen in programming langauge snc then Te permits the grouping e information saree ents tr tacalbolly mate coereton ee ae aware cose ee a one om rl eaten eee Fees ert Eh oa foe Wate pe peeoerreeaaay See ene tes ‘enforcing data type restriction, vel totbasie dats yee chosen ner and charac uing, neues reve net ofa daa pee “eanlig yotsetnamacahn sue enTecs srt mene cc Suna py co hsratet Se tana oe 8 Fourth Semester Programming Language, May 2010, aay, each containing 20 ral ne. ach ara declared seperately ond he ey ‘try deeripon repeated eh Daring the 1970 the conto dat type was extended beyond just a eto dng ug ein he pert iat on tab "er pantie ep suchas wel ond integers ange rove yt aay varie ofthat sf an a jest tht smelt By he Brame '@5-(e Define eneapastaton and information Mina? ‘Ane Information Hiding tithe os rb etal rine inth. elgfeamrtind tain, cots tse, he ef ina hiding the hiding of design dene m computer program that are et ely shang, thus protecting other parts the progam fom dang he design decisions ‘The protection involves providing etabe interface whish hed the remade ot rogras fem the eopemnentaton, “The most common wee o formation hig or: 1 "Tohide ele petal storage layout fr dato otha ithe physi storage Iayout 2. Tomake a program easier fr the wert understand ‘8. Tomake a program protsble between diferent languages and machines, 4. Tome certain security measure posta. 5. Tomake able necasary and eesti details and hide everything else ‘The information hiding falitis flowing? bind f changes in oot oriented programing languages, (i Implementation Changes Il interactions with an abot ae throh its Interface, ten alert pd dat sre biden behind the nterfae can be chong (0) Inheritance Changes fll Interactions are trough the iterace fo 8 uperlat then the program cant extended by ding eablases, "Excapsulatione method ofwnermation hiding on abtracten, in which data ‘ctofinormation. neitherennibe viewed by seer or heute eas manipulator asses the hidden information ereore, the tchnique of hiding the used data structure and to only provide a well defined Interfaces known a encapatltion, ‘An encapsulation ia groupog af subprograms and the date thay manipulate An encapsulation which is either seperately or independently compitable provides a Sbatracied tyter ands logical oranieaton. “Advantages of Encapsulation 1 Beeapelation fo parteary aprerram, 2. Anencaprolaton may lea provide ascze contol ait entities. ‘8. Bneaprulton provide the pograraner wih method of organising rOgTaD# ‘hat also limits recompilation portant in permiting easy modieation of Student ame ering : sadeat vad [Name ) string Doteanboiean ‘Akash Books o {Q0.(0) Deine impliet and aplict sequence contol ‘ne-Asequonce contained athe contol torr fection fopratins sh rtd wer dtd “roueace tral rate dest the ede of program atracions The fe. haan suction lows anther in sguenc cea th ental and order of re pscquence—ontra structure may be either implicit on explicit. Implicit Scquenee Control ings sxucrn contr srtres arthone defied ty tntenguage lpi sequen cnt detente order ofthe scents {theses rogram ory thei inentstin mel Poe plc ween conte “Shature tendo be meet nls moiety he progamimerepliaty The sample Srp sequence onl nee iahn many pregraming laneuges, the physical sequence of tatements provides Aho sours cnt ethane or ecan UGidlorgunge dened dened hererehy of erations provides the costal for easoon rds oajrain. xplct Sequence Control Expt eqns cnt stratares ae thn defied bythe programmes to nosy the spt mqurne conta dina bythe language "Tae exampls ofan expt sequence contra cade: (a) The progrtner nyo contr sated ou change he execaton order ceifnatcmene i (0) The provrammer may ue goto sateen and statements ables tar imp soquence contol (©) the impli exeeton order o operations in expressions can be explicit ‘oed by ting ponetnss wih nenpusins (6.18) What are focal date and local fone Ane. Su procras ae generally llowsded to fine tei own data cle acl sata The loa at odefined toi the tbprogram apd cess tthe ol Sta sly ern he abprogra in which ae dein tertore the uct Se St aubprogram defines the lea releasing enirontens, The local receensg avionment of subprograms Uo fener ssacationsaveabe fro "eer tht may bedtermied without ingot the subproatyactvanon ‘hee dat dined by the cl recrencngenienmect nso {Local Variable: Declared in the oad of sbprorom, These vals ae aso cae aca case acest them te ualy srt toe sebprotene aa theyre died The oa varablescan bear static er teddies ee {rhe ll variables are sock dynamic they are bound ta storage when the sutvrorramebapnexcetion and unbounded ftom storage when Ue ores (07. (a) Write the one Ans. There ato 2 wayeta make dats obert slat oe oe ae » be a an operand fr an tho reslt of maltilication is transmit bern Si Wddirecly a an operand of aditon 10 Fourth Semester Programming Language, May 2010 2 ttt tent ‘ropes aurhnansiaeotureenonmie cee ee ahr dae Tepe nce ened Sree Tears ma oe eae 2 cpt SIE Sapam oercne penne eect mn Pees reece neers cmmeatieeee Tetnngcgaentfemtraren my belo Peis Souter $ ofuinumec eae 1 pete et ar anand ate et smtp Cnt cnmanaapencgan rota Le eee “a outst 2 Sette sn bestpapan ea ppm caine respon Sera RL Seals ali ady et ion re hn dp Scent ee (bio traxey 209) (be (rnE=Arare)) 2000) ‘Tree Structure Representatio mechanism in exprnson functional composition, ‘An operation snd its operands ne specified fee representation for quardti formula ‘Akash Books| n (44.6 Detine satan Dynamle scope. ow efor Qe ay 201 Qi ta) Whatarcmajorrun timeclemente requiring storage? ‘Ree Theproeamner tendo ew trgensnagenent argelyin tm forage in Media poams However anime sorage managment eam paees sa cathe mae gram andataeemens rears orage durre oe Eitieesegeen ee “Code segnen for translated cleer Programa: Ams Bick taragyin eet suns allncatd tore he cose sgments representing the droped om f heir prea Syntem tun Time Programe: Anetherasbtantia ae of erage during Sion must be llcaed to sets pogaos that spore ascotan of ‘Uner Defined Data Structure and Constants Space for wr deta mst [Stccsted forall daa structure declared or rete by aur pogroms Subrprograms Retern Points: Ssbpeerans have property hat they may Sewaned rom diferest pute ia a preram, Referencing Environment: Storag of efeensng environments diving ‘son yee rbstantl spc. ‘Miscellauous System Dat: In sos every language implementation fer vous nem data table, status information for ‘aroun misclanous pst of stata information, 8.0) Explain the conceptofetatic storage management. ‘Ans. Sate strge or memory lation refers oth pres floating emery copie tine tte the tvocated prope i meet, eae dune menor? Seat orate memory location where eter Sa alls a egired ‘An pitino thie tacniqu insoles a program module delaing the sate dataset tht thee data aeinnsesbain ther tadules aces hacen a itor paseo pareters rete Asin copy of tate data ie retained and acre though ny calle he fan in which ti declared. State memory lection therefore has the edvantege af ofularzing data within program designs the stanton where thece data must be ‘tained trooghton ine of peg Objet constants Hnown at com wo w time tke string ea re ually ated teal Teron Points: ree "Sip cata + Alezaton dng tranaaton mins xed [zoo bar ‘+ Noruntime management, so1noconcern for recovery see Unt FoR emi ~s : AN, COBOL alto permits static data to create efficient execution, Se | acpeens an Ren 2 Fourth Semester Programming Language, May 2010 i ‘Static storage lactone ent benuse notin or spacofs expended fo an an Sn areaninettientines | eee | Se omeee ete anon mts etinansi ca water en mee se Casco mene ss st thle imino tt seal serrate nore sentence ne eee eg aoeia vivian tinae onateere tion ner ta Petrie tei Se evecare sata ec etc ate eS ems Calling seenee + Prologue + Epilogse ee Teen Saga ‘eal abo fe = acabne saoane eka € Rearnaal x . [en ran ca 9. Explain heap storage management concept in detail. ‘Ans. Refer Q9 of lay 2011 + Rafer QS of May 2012, B.TECH (F-SCHEME) FOURTH SEMESTER MAY-2011 PROGRAMMING LANGUAGE (CSE-204-F) ‘Timo hes. MM. +100 Note) tempt Pe Ques in tt atest one queton fom echwetion. i) Quctons at ronpch i) Bao queton ort arts 20 marke) 1.10) What doen tinker do? 2 Ane Atkin cpa ar th an ore gery compar andcombnes them ino inl execeaepotrm Aker reece ee finvntsexctabler td shared toes Thelnkr take ee and binary les aniombines them ato on lad ede. La Seren eit fl een schon tan neo Resta ibe tterece that exits when yo dears wmethingeserniyeroterene sree {atinmt dane the epeoteeeencay e * 1.) What areformaland actual parameters? 2 ‘Ana. Afral arate patalr int cal data object witch ‘The sabororam Gfnton ordinary Its the names and dedaration read samen ab prt of pean ‘An acl parameter is data cet that shared with the cle sabprogram An cura ay b's ea ta tebe ne Ferameter ‘aller mayb ole data et abl tale Anant gree, [Srcrvnted at the pint ofa of appr an expec Q.(c)Inwhatwaysarecosoutinedifferentfromaubprogram? = ‘Ans. Conventional subprograms are suborinte tote callers. Wena rotioe sqittangecn i Spe a et — — t [—"|_t T 1 Resume 8 | ‘Resume A 7 i {When ant oft ia or exhort tras tien progres ‘efore completion ofexecution such sup programs are termed as conoutine, 1. Which produces taster program execution compiler ot a pure ‘interproter? wis * 2 * Ans Compiler, Fourth Semestor Programing Language, May 2012 4. Give ties fundamental features of eet orfented programm ‘Ana Some f striking eae eiented programming ae 1. phason data aber than peed 2 Prams ave dvd nt wat are kon a beets 2 Datestretare devine och that they characterize the jc {1 Objets may communicate with eoth ther enough ftions 15 Dati iden aca be accessed by extra fnction {6 Neve data snd ontins can be easly added whenever nEcseey 4. cal by au mechani ined for parameter psig and pote fr call leone Q.1.(p Potine the concept af abstenctionand data hiding a ‘Ane Toformation Ming: I the tei sed for the ental principe inthe design sf progammer-definedsbstracion In computer acence, the principl of ‘Sotmation ante hiding design desson in computer program that ae mast Titty to change thus pootecting other parts the program rom change ithe design Aesison isehanged “The protection involves proving stablentrfce which hes the reminder of program fom the emplementation. “The moe common ures of information hiding ar: 1 To hide ele phyla! storage layout for date 2, Thmake. program easier fr te user to understand ‘9 Tomek program prvabl between diferent languages and machines 4 Tomake certain security mesure practi ‘ 15 Tomake visible necesary ond ersntial details and to ide everyting ele. “The jaurmation hiding faite following? kind of ehanges i objet eiented programing languages. va) plementation Changes: Il iteraction with an objet are through itt into tengo od daa strstr hidden behind ths terface can bochanged “oy Inheritance Changes: ll interactions ar through the interface to 8 superlan then the progam ca be extended by adding asbelases, “Exeapeulation: Ia method of information Mding on abstraction, i which ta or tion, eiher cn be viewed iy usr norte user ean manipulator aces au thotechaique of hiding the used data strstr and tn ony provide well dained Interfore it known as encapoulaton "tmeneapuultion na froupng ofeubprogrem andthe data they manipults Aa neon jaica nih is efter coperatlyor independently compitable prvides a2 Abetracted sytem and alia organisation ‘Advantages of Encapsulation permitting easy modifintion fon may alo provide accous control to its entities. Akash Books 16 3 Rneapulain proviethe programmer with amathod of reusing programs dent vad Dolean tool 01.) Name various parameter a. arias parameter eens 1 Cab mae 2 CallbyRatrnce 3. Catby value 4 Cally constant vate 1. 1h Give the diference between anerray anda vector 2 ‘ns. Array ante Ldinesiol imental or ml dimentna ‘ctor ino dimensonl rey sidney te potion oe aggegnrelancinonee eee heer ectorn data structure comoned of fed na of emponens of type organised imple linear sequence. naa Q1.(0 What doyoumean by an activation record? 2 Ans. Teens ptr activation a pe plate the entire ‘eoplte might oped nts aw arn casement tmctmaagsnocematra ‘nt einen — ap mtg tec tre tte ea ‘eh as temperaray storage areas rel sees . cum pols and linkages for referencing nonlocal jmision schemes 2 the template into 2 parts 1.) Dotinereerusive subprograms. 2 Ans. Asouens ct karate catttacmentcrtrtevecnndta che ompnt ler ‘string is the no of bytes in sequences acres ‘ethnical empty sig Tis ues ass seas sie ra cand, ob > Ucunea eng sepergn OO acta 16 Fourth Semester Programming Language, May 2011 SRCTION-A @2.(a)Eepaintheyariouscharacteristi of a good programming langue, ‘Ans. There ae vats factors, wy the programmers prefer one lnguago other snuther same! the portant reason fora gol programming Ingo re even 8 Readability: Ato factors g int determining whether anguage is Fendate the ont blouse Te vray ofthelanguage should ‘eeembles Bago 12 Orthogonality: Thetermerthoroality refers tothe atsibte of being able ‘Srombine ara feature sfatanguage all posse combinations, with ter embinton teagan '& Portability: One important ration ofeney programming projet isthe {tansportai fretting program rom ane operating nate tootber A {tnquape that owes avaltle and whe inion isinopendent ofthe features of partielar machine forms useful base fr production of transporable rosa “4. Ease of Program Verification: The reliability of programs written in Ianguageisalvayeacentraleoncer, Thee are many ecnques for veng {Gotaprocram camel perfrmsitregtred functions, rogram orange ‘hat shes propram vesicstn Meat maybe fr more toubesome to {oe than an Gat supports and simplifies vereaton. '& Safety: The language eboud not provide atures that ne it possible to ‘este harafal params. . {6 Naturalness: language neds aeytas that allow the progam structure to ‘flctunderping opel structure of program, It shoul be posible to ‘ranloeprogras deen crcl ito appropriate progeam saterents hat ‘llc the srotar of algorithm [Abstractions Abstraction hides complesity. It Keeps only essential {Rformation Details working ofeny exity set require, {& obustrese Alangunge toulahaveebstoes that sit provides the bility {h deal with undenved events, Soe guideline to ensureebusies. (a) Atwaye validate input data (@) Adwaysinilike elavent variables (@) Avoid ryntactie onstracs that cold lead to undesirable interpretation, ‘9. Cost of eloe: Cat is certainly # major element inthe evaletin of ay precraming language but cost means many dierent things (e) Cost of program tranaton: ime) (6) Cae fr program execution (c) Costof program creation, testing 2) Cost of program maintain Q.2 (6) What are elementary data types? Give specif {mplemination ofelemeatary datatypes in detail, "Ane, Asta typeis acs of ata objets togeter with st ofoperation of reting snd menipalating them, Every language han a tof primitive data types that are uiltintothe language In sition te langues tay provide fein to creat new data types to. ‘Akash Beoes ” Speciation tat ype Basco pcilntion tap: + Vale ‘Aucibutes Bane atributer of any data sully invariant during feta, 27 Sata eet suchas date type and name Valuos: The typ of dat objet determines t sat typeof data object determines the ae of posible valu that it may rere ttn = Sentero a rena waits eta tate ndrendnt ation mony Ths cach datdjet of gente e *gardless of its particular position in the compute ‘The representation is usually desersbod in terms ofthe jot emery roped “eaten treat oe mshi ran cope coe i eto Sent Hy data type: The base ideaorelements of tpn wa pete egentpemar niapenmtetinanectoway acne rare Implant te operant he Sedo ae Schumm (ii) As a function subprogrs opr might sear ae $s lmplemented ava guar rot eubprogac that calclates oe one aaa os Sest ote tg na ean pied into the program at the point where progres ‘abs (x) wifx-<0 then- else x 7 ili) get x mae ae ear valu ofsin memory where ea Ory wher caching isimplemented hy a single 18 ourth Semester Programming Language, May 2011 Q2.1a)Writeashortnoteonmumerie data gre ’ haw Sone fame nme data fun alst every proeeing Lana ante ea nantes tp a tems omen beso they are fen det ‘inwedin putes len specication: data bjt pe nese aul hat tha att tend gp best tg scars ed forthe pe fo en ordered suet SShinvome te ands teint net ter {Cha teen nse cits int sort, lng ‘Operains on inte at cht ead ain oH inary Airthtc Operations + Unary Aithmetc Operations * Relational Operations tumptementatlon: The language defined iteser datatype i most fies inplemented rings bardoare dened ntege strap representation and et nieve het ond laos poi operations an iteger ‘Taye posible toragerepreentaton fr integers ae 1 Teas eatin deeriptor i) mores deserptor in eoperate memory lation ii) estores the deterigtr and value easing memery colton ene Levante rr sonoe (at o Nf Tireseaceer Sante fare Akash Books 19 (2) onting pat teal Numbers (a) Speeiention-A eating pot eal no datatypes en speciied with onthe tingle data typ leat real ot i PORTRAN, "The nme erthmati relational an assignment operations dveribd for intagers ually iso provided for el, ltiugh the Bonlaan operations ar sme ies soneted Implementation: Storage reprerentations for Meating plat teal pes are “exdnntiy tant on undying hardware epesentation in which worags lation {Snded inom unter and a exponent Dosbl precsion frm of foting pint numbers la oan availabe, a whichon dana! memory moulds Usd to store en extended aston, 1615, = MO IgO 101 x2%=0.10%1, 00%), ing it for manteea mantes (2) Fixed Point Real Nombers {) Specification Most hardware includes bith and eating post dat cst owever there are many aplicatons whore spel ational number sreeded. "A fied point number ereprernte 2 gt squanen of eed length, withthe ristiontd a given point between to dis Implemention: xed point type may be directly supported by hardware or stata euler tay be sisted by stare. ‘Q3.(b) Explain enumlation in detail? Ans, Wooften wat arable take on only one of amall nimber of sybale yalves Gender might hae nly 2 values representing “aol” and “eal” In eee Tangonge such a FORTHAM or COBOL sth variate eos given te data ‘ypeintoger onthe ales ar represented a ti, aria choweea noger, ‘erog Male =0,fesale = 1 {a Specfieation: An enumeration is an ordre list of dstrit values The programmer define bath th itera ares to be ted the valace and thee ordering ‘Stnga dectaration such on ‘num Gender als, fell; ‘num student clase, spe, Juste, ein enti forexpor Bec eriary may varies of ne enumerton pe aréuredina program, ‘cis common a define he emerson ina sparta pe adaon and gies pS Sane that ean then be redo speatythe Qpeotmverdvarabes ‘ype clan =(Presh, Sapp, unin, Senior, ‘alowed by detrations for aiebles auch ak stdent es: ene ‘he values recalled numeration tera, shown here sidentiers they can also ‘ese far ariel nme n many lnguge, the Desoan types eee redefined enumeration type; boolean = (base, truck, me -) rer Bee Fngamig spe My 2 area eee eee cmon ne eta Oe a ernest bor anaes peepee wig pees eat rem eae ng eee eee Seco aa ceieen onsen create eis eas a ee roe rita et Aes Farm a are re ener ees Siiecetva: nea ae re a eer 20 wo Stee — [em] >, coat rogten igretgt) - ashi ie ang) ' Fig ACompiler Executing a program write in a hgh evel programming language ie basically @ twostep process © Thesource program mut frat be cniled i, ranslated in bc rogram) (Gi) Te resulting objet program isoaded na memory and executed ‘The above twostep proces is thown infgue Souee Program —+ [ene J+ ct eam [> cnet roam out and Brecstion. Advantages: 1. Acompiler translates e program ina sng run. 2 Ieeonsumes la tine 8. CPY utilization is more 44 Both eytactic and semantic erorecan bo checked tthe sme tie {5 Itiseasly suport by many hgh lovel languages ik Pasa, C, C++ ee ‘Aes Books 2 Disadvantages: 1 eis ot Neb, eeannamce more race. rer loan i dil. ve aller rtent in apragram ca case the mol program tbe “Anebjet program produces uusly mach rgr than the source program that paced (i Antorprotor: An interpreter i sea 3 6 = exteate ‘Stelter tho fie ine andre the anasto ‘Gesecondlige renee Ths interpreter a nvmemory forthe randatod nes sof teomen es ines ofthe pram within aon, must ‘tonite them lech cvery Une that parsel Tnerune Anilarpretr thereon rans igh leelinstractons nt antennae form hich ICthen executes Te process of interpretation omnia gue a eens ‘eee Soyo aan os tit oe pea ise fa ne See attention Se mpm dt ieivamnintcuanteenn ae states meet Santini ot mimesa snes talents ener Seman here ci pr na oa apa a note in aa ee ao Saget cag eae rian rhe both define the names true a hs tne 1 fal for the vals of the type and defines the Fig.Anaterpreter a 2 Fourth Semester Programming Language, May 2011 ‘The most comson cperatant on Klean types neds assignment 04 weg land) Boleen x fclean + Boslean F ; Bolean« Bslean Beslan ‘ot; Bolean = Boles Other operations icing euivaleveexlosive, implication, rand, nor and sa iro evatanto for the bse operators implementation: Blea value oad be represented a singe bit but brag acingle bof memory ie iit oases fenton any machines, hey ae ata ‘omdisthe smaller efcienlyaddeusable cello emarytplaly abe, Thre ‘wo options. 'e)_Apartiodartitie used forthe alae O= flee, =troe and the rest ofthe bia ceteris senor. (8) Azerovalue inthe enti storage unitepresents false, and any ober ns aloe represent tue Evaluation: 1 Boolean types arecten wed to represent witches o Nag in program, 2. The us of Boolean types is more readable 3. C oes ot have an expt Bocean data tye, integers used ‘Tris any non zerovale, and ale is. SECTION Q4.(a) What are structured data types? Akash Books 2 ss Data Structure The varias operations that canbe cariedout oe dna tre te 1: Component selection Operations: Thee ae hei 2 ype of xsponeat seltion operation. ta) Sequential component selected operations {hy Random component election operations 2 Whole datastructure operations: Operations ay tke etre at strate an arguments and produce nw data strane a rau of iuens oF 2 sre ' IntrationDeletion of Components Operations that chang the aber conponnts in ata stractar haved ajrpacton sage oprveiation, “CreationDestruetion of data structure: Operations thatcreate and destroy dna etrctre also havea majorspacon storage anagetent re dat store (QA. (6) Define major attributes for specifying data structures. 3 ‘As data object refers to run time gringo oe or more pie of data ina sua computer Ia dati ineoapestot ear atacboas kine ectred Unt ctjet or data stractare screen sted ae tnd cab omen ort ay Se ther fore Anaray data ojo maybe composed of sina closer ta objects Speciation of Structured Daa types basic element of specication are Ans If data object is composed of ether data objects it is called structure (a) Attribute object or data structure (0) Values ‘The basic elements of specification of structured datatype ar (©) Operations levatbate Implementation of trctared dat ype oie (a) storage Representation () Operations (©) Implementation of operation (a) Major atteibutes are: (©) Storage management and data object (Namber of components: Basedon the numberof componente a deta can be ether of fiaed ss or efveriable ste Basie attesbates for spesiention of dat structure ae: Fixed Size data structure: numberof component do not change during Data object, time og Array or Record. Data type ‘Variable Size data structure: Ifthe numberof component vary dynamically ef) constant stack ist. variables ‘2. Typos of each component: Batedontypecfeachcomponenteampuringadall) titer strveture ican be either homogeneous oF hetoee ne Qu.) Explain varlablosized data structured dial. 10 ‘Homogenous fal ite constituent components ae of'ame ype eg array. Hetrogenous: Ifitsconstituentcompanents ae diferent types. eg Recor 3. Names to be used for selecting components: Adata structure type neds ‘Ans. There are data types which hae more than one dat objet. Ii als called ot structure or structured dat pee ‘Variable sie data structure can nse lection mechanism for identifying individual components ofthe data etustore Ta “4. Maximam number of components: Fora variable sie data strcturesuehi§) character string or stuck, a maxim ste for the structure in terms of number Queue components may be specified, trees 5, Organization of the components: The mort common organs 4. Directed Graph 5. Property st linear sequence ofcomponents a ‘Akay Boks 2 hilt iatewaton Theres, trig hdingthe ve dat atracture do 2 onviden wel ina irc ihr on eenpmaation Ned for Hnenpwatatlons When thot pga setae a fotos "etter wnat ote 2. When program grow beyond oth En Fourth Semester Programming Language, May 2011 5 ce Specify operations and implementation structured dat ypeqy ‘Ans. Sjciention of dmain and rangeafoperations onda site typer my ienin uh the se tanner as relementy type. Some new classe oper oval partial portance 1. Component Selection Operations: Processing fata structure ten sisi by rereving euch eorponent ofthe srr, Tw ereving each component A io frat problem ls mdatrnton an for eco problem la complation EN ETS Scene te seh gic An tocopolton «cman st that ea nla ealeton of tegely ie them vale fr posing ther operations ited ty beso abprogra, Infraton hing ean bo hgh fs bolg th praia and neaprlation being ‘Advantage of Eacopatons 1. Frode modieaton of program 2 Provide sca contralto entiin Provide he programmer with seo of npising program that aa nite W) Abstract Data Types Many languages defied aed typoCADT 08 aot data values und nnlated oration that ean be porforied en the data nto sa typoinnbtractintho vena tht a tndpeet taro cme npementatinn ‘ADT conte of 2 pat; |. Data This part etre the strc ofthe data odin the ADT Operations: This part describes tho valid pert fr os ieerace. £2 Wholl-Data Structure Operations: Operation ay take oti ta trac fs arzument and pros sow dat strstr a rel Mos lnngoges provi Hie et of sch le data stature peas 3 Inertion/Deletion of Components: Operitins that change the nur none ats care ar pc on tag preston 4.CreationDestruetion of data structare: Operations tht eeat and dvr ats structures also have aor inpact on sarage anagenent for data truce Implementation of structured datatypes: Storage Representation: Storage representation rs data srt incu 0 storage forthe componenaof rare (®roptona descriptor that sore ome oral ofthe atibte fhe seta. 2 Basie representation é (@ Sequential Ropresetatio, ia which the ds otra ADT onc, tones ‘onlin Baek af rap thet in and componcts omens (Linked Representation awit dts seed ever

You might also like