Assignment_2

Assignment_2 - Homework #2 Due Date: Tuesday, March 8th,...

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

View Full Document Right Arrow Icon
Homework #2 Due Date : Tuesday, March 8 th , 2011 ( in class ) (Due to the need to post the answers before the Midterm exam, late assignments will NOT be accepted) Solve the following problems : 1) Exercise 3.5 page 110. The "sum" procedure is shown in page 109. ( 15 pts ) 2) Problem 10 in page 141, but after adding another case "e", where both parameters x and y are passed by value-result. For each case, show the changes to the values of all involved variables (i.e., array A and i, in the caller block; and x and y in the callee P) as you step executing in the code. ( 30 pts ) 3) Given the following ALGOL code: ( total of 55 pts ) (* please notice any text between (*. .*) is a comment. Also, all labels blk1, blk2, blk3 are not part of the program , they just to show you the starting of blocks’ codes.*) main : begin (* main program block definition *) integer a, b; real c; procedure P1 (x); value x ; integer x; blk1: begin integer f; procedure P11 (y); value y; real y; blk2: begin real r; r := y + b; PrintInteger(r); end;
Background image of page 1

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

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 2

Assignment_2 - Homework #2 Due Date: Tuesday, March 8th,...

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