CSE 221 Lab 4


Table of Contents


Objectives


The Problem

Documents, like the one you are reading right now, usually consist of a series of words, where consecutive words are separated from each other by one or more "separator" characters. The space character, for example, probably is the most commonly used separator character. In electronic documents of all kinds, the space character, the tab character, and the new-line character are commonly used as separator characters. In fact, since it is possible to have more than one separator character between consecutive words, such as two tabs followed by three spaces, it makes sense to think of a document as consisting of a series of words, where consecutive words are separated from each other by "separator strings".

A commonly occuring computational task is to "deconstruct" a piece of Text into its constituent words and separator strings. For this assignment, you will be implementing a Remove_First_Word operation that can be used for exactly this purpose.


Set Up

  1. In a terminal window, create a new directory (folder) for this lab by typing the "make directory" command:
         mkdir lab04
  2. Change or move to the new directory (folder) for this lab by typing the "change directory" command:
         cd lab04
  3. Copy the catalog for this lab by typing the "copy" command:
        cp -R /class/sce/now/221/labs/catalogs/lab04/* . 
    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 one file: RFW_Test.cpp

  5. In RFW_Test.cpp you will find a procedure header and an empty procedure body for the global operation Remove_First_Word. Implement Remove_First_Word and use RFW_Test.cpp as a test driver to test your implementation.


What To Turn In

The rcpp-submit command for this lab assignment is:

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