hw7 - Homework 7 : questions a) draw blocks around...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
VERSION: October 30, 2010 CS-441 Fall 2010 JWJ CS UK Homework Assignment # 6 —This material is only for use in CS441-Fall 2010 in the Department of Computer Science at the University of Kentucky.— —Please, do not distribute.— Due: solve by Tuesday, Nov 2, 2010 Learning outcomes: The assignment contributes to the following concepts and learning outcomes for this course: LO Run-time memory management LO Activation records LO Static and dynamic scoping. hw 7. program management; var x,y,z: integer; procedure october; var a,x: integer; begin a:=1; x:=a; y:= a+x; z:= 2*y + z end{october}; procedure november(d : integer); var a,y: integer; procedure december; var x: integer; begin x:= 3+y; november(x) end{december}; begin y:= d; if d> 20 then write(z) else begin october; december end end{november}; begin z:= 10; november(z) end{management}. 1
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
VERSION: October 30, 2010
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Homework 7 : questions a) draw blocks around procedures to indicate the block structure of the program. b) what is the nesting level (largest block number)? c) write the execution history for this program in the form: program management starts management calls november(10) etc. d) draw the call graph for this program (a tree of calls). e) Show the stack of activation records directly after the instruction if d > 20 has been executed for the second time. Use the static links chain methods. f) What is the output assuming the static scoping ? What is the output assuming the dynamic scoping ? Each cell in the activation records should hold a value (return addresses may be left blank). For reference see notes and handouts, in particular 20101026.pdf 2...
View Full Document

Page1 / 2

hw7 - Homework 7 : questions a) draw blocks around...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online