CS 3304 Fall 2000 Homework Assignment 7

50 Points
Due: Monday, December 4, at 5:00PM

The point value of each problem is shown in square brackets [ ]. Your solutions must be prepared with LaTeX or other word processing system and submitted as a stapled printout to a box outside the instructor's office (McBryde 638). This homework is due at 5:00PM on December 4, 2000. No late homework will be accepted. Complete each of the following problems and turn in your work:

Appropriate comments must be included in all your programs.

  1. [9] Sebesta Chapter 6, Problem 9, page 285.

  2. [7] Sebesta Chapter 6, Problem 14, page 285.

  3. [9] Sebesta Chapter 7, Problem 3, page 324.

  4. [10] Sebesta Chapter 7, Problem 12, page 325.

  5. [15] If there are no issues of aliasing, then in the sequence of assignments
    x : = 3 * a + b * (c - 4 * d);
    y : = a - 2 * b + c * c;
    z : = d + a * (b-2);
    
    the order of execution has been overspecified, in that there are 3!=6 orders of doing the assignments that achieve identical results. Use one of Dijkstra's guarded commands to express the fact that the order of assignment is irrelevant. You should avoid thinking in typical von Neumann deterministic terms, and you do not need any new variables.  

copyright © 2000 Virginia Tech, ALL RIGHTS RESERVED
Last modified: October 25, 2000, 08:11:39 EDT, by Lenwood S. Heath <heath@cs.vt.edu>