CSE 221 Closed Lab 2 Warm-Up Exercise


For this closed lab you will be providing an implementation of a new Text operation called Concatenate. The formal specification of Concatenate is provided below. Either on your own or with a closed lab partner, and before the closed lab, write a procedure body for Concatenate. Review your code carefully and trace it on several example values. Do not enter your solution into the computer until closed lab. The idea is to have code that works the first time you type it in, except perhaps for typos.

 global_procedure Concatenate (
        alters    Text& t1,
        consumes  Text& t2
    );
 /*!
    ensures
        t1 = #t1 * #t2
 !*/