Homework #26


This problem requires Lecture 25 and book section 3.9.

Exercise 3.64, p.122 - (30 minutes)
Extend the block statement to allow variables ot be initialized. In the solutions, does the scope of a variable include the initalizer for variable declared later in the same block statement?

The problem says "to allow variables to be initialized". For simplicity, make it so that all variables must have an initialization expression and be of the form <identifier> = <expression>. For example,

    var x = 1, y = *( 3, 4 );
    {
        print( x );
        print( y )
    }

Make sure to think about and answer the associated question in the book.

The interpreter with statements.


You must log in first before submitting homework assignments.

Instructions on submitting homework is here


Last updated at 3:42 pm on Tuesday, January 20, 2004.