CSE 221 Lab 3


Table of Contents


Objectives


The Problem

The problem is to implement the remaining Super Text operations: Swap_Substring, Is_Substring_Starting_At, and Substring_Location. As in Lab 2, we will provide you with a copy of the test driver Concatenate_Test_Driver.cpp, which you will need to modify to create test drivers for the remaining Super Text operations.


Set Up

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

    This "copy command" will copy recursively (because of the -R) all the files and directories from the shared class directory into your directory, effectively duplicating the entire substructure from the class directory into your directory.



  4. To see what was copied, type the "list" command:
         ls
    You should see

    You will use each of the three directories for the three operations to be implemented. In each of these directories, you will find a copy of the test driver Contenate_Test_Driver.cpp from Closed Lab 2. The file Operation_Headers.h contains the exact headers and contracts for each of the operations to be implemented.

    We recommend working on the operations in the order Swap_Substring, Is_Substring_Starting_At, and Substring_Location. For each of the operations, and working within the appropriate directory for the operation, repeat all steps from the How To Proceed section of the Lab 2 write up.


Very Important Note

Do not implement these operations in terms of each other as was done in the Activities for Unit 8. For example, do not use a combination of Split, Concatenate, and Swap to implement Swap_Substring. However, you may use Is_Substring_Starting_At in your implementation of Substring_Location.


What To Turn In

Use the submit command (NOT the rcpp-submit command) to turn in all the files you created or modified for this assignment. (A good discussion of the submit command is in the writeup for Lab 2.) If you have followed the above instructions, then the easiest way to do this is with the following submit command, issued when you are in your lab03 directory:

where "xx" is to be replaced by lower case letters designating your section (see the course home page for a list).


Want To Do More?

Here are some possibilities:

Any extra work is strictly optional, for your own benefit, and will not directly affect your grade.