0% found this document useful (0 votes)
4 views53 pages

Programming Language Assignment

The document discusses programming concepts related to variable scope, case sensitivity, and memory efficiency in representing Boolean values. It highlights the advantages and disadvantages of using single bits for Boolean representation, emphasizing the efficiency and complexity involved. Additionally, it explores the implications of variable visibility and dynamic scoping in various programming languages.
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)
4 views53 pages

Programming Language Assignment

The document discusses programming concepts related to variable scope, case sensitivity, and memory efficiency in representing Boolean values. It highlights the advantages and disadvantages of using single bits for Boolean representation, emphasizing the efficiency and complexity involved. Additionally, it explores the implications of variable visibility and dynamic scoping in various programming languages.
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
A\ssignm er on Tepernig | an yr oes Asst a No. “ oL 7 Dede al Gob mi gclon 1 Ob Maneh LOLS Gourse Code \ 612P Ghaplen Spon’ Chapler 5~% SubmHel By Gobritted Go Mehedi Hasan De. MI. Ezharel Tslam Loleh Go Foulty .@6E Deparebmest TD" CSE D026 01084 Cy -ordinetor. PmMbes ~ Dobangionegar University — Chopler -5 on ees @wheh of che Lollosing identifier forms 1s ) 9 mest Pea oble ; ont Gales, sum_ot_ coles Sumok SALES Supper’ yn deeigivn. Arsis From m4 point of view, here the es “Veodable dent Ger is com of- wales JB Gt Clear and explicit separetion J t% nes} read able hen chhens. In gum of sales ) the ww undersa ores Bele Sfp Separate eooh word meking Fall cosy +e ocean avickly . Bud} in SumO4Sales ; rend aa roc mentally parse tele vel ial wore slowle and ond which make Shoo ly Tn deve , SEMOFSALES iy die least veadable word because i} PeMoves Visual bow mares mee lovles Ghee an i Laas) long v € constant or meere 1? 4 qveges. So, Sem o{_aales 16 she Les} eholee oe lid es fe cielly . Ae ee programm") . greet porpose ® Whe whe polertial danger of case - sencitve named) Pmswer i= The we of case- sen citive names 1 preqre raining Jonvanges ee et eee pelential couvee of error het oan regos a) effect ede read ab} bh ang woindanebi hy Eee ence Sy Shems, iden difens such a WAR Vario ble 7 Sea ond VAR ABLE Joeote ] ore dnewhd as ely, ewhtes , ded. Some. languages Iie C-Lose d lang oagees are Qase Sensitive » Thalys oe ages Ves Ih fre inonensed probability of Lyegrthnel omens B seoreme mang unintentierelly ver thee eopitalizecten wl on identifier, (ending fe che ercecton cae veniaule rolker then dhe neferorcing dye jalended ene. Forthermene. ese cengihialy erate cae sy ren dob ond eon cicteney porkes bol, in ahah nee envinon ment . © ons Y ‘ Consider phe Allowing “orogar ip} sLele fe} Haase ‘ The meta Progr own VOY wn) Aonetion sobL 0) 1 Nor WU, fone on Sob © OL. _ s fonerhion cob 3A Ascume juod dhe ete of “fig Prog rein ig te tee fllouteg oni) order : rain colle subs mob t ool ob Sb aolls — eobt a. Pssumir a ctoh'e Stoging xo he “Alsi. which Jeo laren of «6 fhe Correa + one for om referees, te ~ 4. colt a: Sob %* Subs 6. Repacs} gow} a, bot ascume Uyre mle gp seeping : Answer We Yeo e thos ‘declarad ons me M: F Ore Mh global (in main) H Ong re foas.| eb Subs ol} Sequence ‘ ' math = shy su be Guba a. Siehe seeping : cbt > sobl’s Joool *« Seba > SobL’ 6 Joon] Subs alba} n” n~ be Dynami speping | ovb} Sub 1s (oon) wm be tol on lool Ww Seb —e WEL ay sobs = re erage ® Gnsider the fellosing ~Jovacarigt Prca par Vor WY >Z's Lareten sbl OF Vor ®& YOR 1 fonetten sobt () L Ver aw, boa 7 ( Hoe 5 eee Avnatton spt () 5 NOP HR, %R, We 2 Z Lisk all ue vorieldes . olong wth fe P pugrom units where fuey ave decked, thot one Visible Mn the Ledies of cbt br ove soba Sou iring cledie stoping tg bed - Answer I Bieiende due subl | o (from 9 Grd vemales ™m got _ dubs (loool) y —_ Sue 4 (lead. S heslous globel v) 2 > wht (looa| . Ghodow, global 2) x —> alobel pees gbbol nm local a=(%, welF . Ke 1S (global variables Yo Gh L % ——+ Sbr Uooal) “ — br Clocel) ” an 4 lvloo| (modified) 0 Global ees globo! SL Sa meets ee nubeos| ov Tl enh Vnriobles in vb! a —> svbI9 (loool) . BF aba Coal | Ahodows global VJ) a > von loe al mw —- lobe-| 4 global a@ Cons den tre sllowing ckele-+e} @ Proyam | void eri (void) u / prototype */ hes § a (void) q he protelape */ Void fon a (ovid 4 |x prety pe * f Void Maly 1) °a a arb, ay Sad fond Gordy ind bolas 4 Void fon 7 (void Q i | nh -ede e: Ie de po & { -- Void unt, (vend ) 2d Civen dhe following colheg Seavemees - Asguwni oh fhe! Aynemie doping 1b ses w lao veamables ame viable dure 4 cxeeviicn of que las) furction colled ! Taolude with ooh vicible vento ble Nome_ of die foyetion tn whieh 4 wos deheed. & Vrain galls fuel +, fend ealls An 25 fone culls fond. bs mats colt fons fond calls toma Cormein cal) fone fone ealle fons’, fone ealleefon). dole valle fons + fone ool onl . ts man doll Ant ston calls tna Ca calle Koy L fon for% Vorlobles S- veri We | Foon die, £ area a ony. c ond - main Ce) main —> font > Lon Vontoa ble | Fpom ad £ Fond be fond may a7 (c) main > fora fon, —> fond Voroalole \ spent », wad 4 ns et ray on | (a) wale fon, fons Vora b) e . ; From 7 4 -fn4 bb, @ fon eo 7 o Main ©) sin find fam fon Voriable. | from Cee tun — mn lo fond o- Frais, Se CE) main ating > fone 3 fond Vaninble @ the wo reference vfo non booa) veriable no & Gletie - seoped Pregrem Menace bo re defingon® Prowem Ty, o fextool seopad P Poy Pern, a velerence te a vnentood! venlable ts oonned 4. ih definition throvg h he proqern’s lenteo| roeture . tene when « voniab\e ts veed Inside. oO fonectton loot mot de clave d locally the compiler lola tn the fooal Spope . Teen moves obticand thou gh ents lext ex copes , Tren it Contes er tf ve) We Yoble’ ‘ \ fi s tthe Vowrtable’¢ Lealarodion Tats eemneertron \ deter mt ned orf dompilen fim . e | exnomp le ‘ ver d owlen (C5 % deh E104 Noid \nner() Y print ("yy \ »KY', Chapter -& (2) Wheat are the opments for ond ogeinst representing Boolean eles «5 single bits ramen ) wierbenes Arowen'- Representing Beelean valves as single bits in memory hes beth odvardages and Uehvontoges , which one ten portant fo eensiden tn system design and proynanning languages tn On the positive. Side, Lsing a Single bit for Beoken Valve ts highly emer - cffisient « Ciccetamt tee esleant ee Pa) yet only needy +o chre Awe goouble values, one bit is sv lbatent ond that tan cignitiannt ly redvoe rmemony veage eolter dealing with lange annags or iar. cheve tyes Con tetn Ing mong Boolean elenends : Tuere ore aleo Ceveral drawbecks fo teprecenrtin Booleans ag cingle bids. One mason iscve i Hat mosle mowlern aompulen architecldunes are byte - addressable . fg o result. monipulate m single-bit Boolean nequires extra ope rtf, While wepresenting Beolean Vales as single lity 4 memory ofberent and bene Hola in certain evmtects, 14} inboodvees pertor mnce over head and Sap heme naction com plexity, @ Wile oar | Program tect ee molt plien-ken in Some Jonguege “teat does subserip} Pamae checking end don las you on Boban a _ . ve ” Ssombly hngvege op mroeb, 4 a Versyon f om the comp ken, Rebermine the nom ker of Ingtove-ls ™& Pe au\ned for the subcerip| Yo . ac cheek}, and Compare it wed total number a toechovelt fr the mbox mov) tip feos ton Process . Answer Were ig Thre rnabvin multiplication, We Jane anguane wilh cob eoniph non a cheeking , Lellowed by nals, of SiAnet instruction overhead . WV LALD © = mews be Be) [a MW Modwin Me Hipliechion for (ind 103 Van Lite) tor Cint Dees dant hed as) So tor Gel esos Kany t+) CTs +- amItds 8X16) \ 3 I prin} result ten Gn) feos ten: daa) d Ae (mt Seo: densd+e) systnod riod @ LG ]e © \ System woot, grind ladys (

You might also like