CSE 221 Lab 2


Table of Contents


Objectives


The Problem

The problem is to implement another new Text operation called Split. We will provide you with the test driver for the Concatenate operation. As part of this assignment, you will need to modify the Concatenate test driver to create a similar test driver for the Split operation.


Set Up

  1. In an xterm window, create a new directory (folder) for this lab by typing the "make directory" command:
         mkdir lab02
  2. Change or move to the new directory (folder) for this lab by typing the "change directory" command:
         cd lab02
  3. Copy the catalog for this lab by typing the "copy" command:
        cp -R /class/sce/now/221/labs/catalogs/lab02/*  . 
    NOTE: The period . is part of the command. It denotes the current directory (folder).

  4. To see what was copied, type the "list" command:
         ls
    In particular, notice the two items


How To Proceed

  1. Change the name of the file Concatenate_Test_Driver.cpp to Split_Test_Driver.cpp by typing the "move" command:
         mv Concatenate_Test_Driver.cpp Split_Test_Driver.cpp
    (This command essentially says "move Concatenate_Test_Driver.cpp to Split_Test_Driver.cpp". This has the effect of changing the name Concatenate_Test_Driver.cpp to the name Split_Test_Driver.cpp.)


  2. Open the file Split_Test_Driver.cpp in xemacs by typing the command:
         xemacs Split_Test_Driver.cpp &
  3. In Split_Test_Driver.cpp, replace the global-operation header and contract for Concatenate with the global-operation header and contract for Split. The header and contract for Split can be found in the file Split_Header.h.


  4. Provide an EMPTY procedure body for Split.


  5. Appropriately modify program_body main for Split_Test_Driver.cpp so that it becomes a test driver for Split instead of a test driver for Concatenate.

  6. Run the test driver interactively to test whether program_body main of Split_Test_Driver.cpp interacts appropriately with the user and with Split.


  7. Provide an actual implementation (procedure body) for Split.


  8. Run the test driver interactively to test your implementation of Split.


What To Turn In

We want you to submit your lab02 catalog which includes the file Split_Test_Driver.cpp. First, ensure that you are in your lab02 directory. Do a cd lab02 if you are not. Then, type the rcpp-submit command:
     rcpp-submit c221xx lab02 
Type the rcpp-submit command EXACTLY as instructed for the specific lab assignment. Look at the response you get to make sure rcpp-submit worked OK. If you type anything wrong -- upper case for lower case, incorrect file name, or whatever -- then you'll get an error message.

Some things to know about the rcpp-submit command: