CSE 221 Closed Lab 7 Instructions


Table of Contents


1. Objectives

To implement the Put_To_With_Commas operation as an extension to Natural_Number.


2. Set Up

Two students should work together at ONE workstation.

  1. Login.


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

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

    In the directories AI and CI, you will see a Natural subdirectory. Within AI/Natural you will see one file: Put_To_With_Commas.h, and within CI/Natural you will see one file: Put_To_With_Commas_1.h.


3. Implement the Extension

  1. Open the file Put_To_With_Commas_1.h in xemacs by typing the command:
         xemacs CI/Natural/Put_To_With_Commas_1.h &
  2. Using xemacs, fill in the procedure body for Put_To_With_Commas in the file Put_To_With_Commas_1.h.
  3. IMPORTANT NOTE: Natural_Put_To_With_Commas_1 extends Natural_Number_1_C. This means that you may write the body of the Put_To_With_Commas operation by layering it on ALL the Natural_Number operations, not just the Natural_Kernel operations.


4. Compile and Test

  1. Open the file Comma_Test.cpp in xemacs by using the open option from the xemacs menu.
  2. Do a Build Project for Comma_Test.cpp. Correct all syntax errors.
  3. Once all syntax errors are corrected, do a Run Program and test your implementation.


5. Proctor Check-off

When you are satisfied that your implementation is working correctly, raise your hand and one of the proctors will come check it. Then you are finished with the closed lab.