All of the work in this project is my own!  I have not left copies of my code in public folders on university computers. I have not given any of this project to others. I will not give any portion of this project to others taking this class. I realize that the penalty for turning in work that is not my own can range from an "F" in the class to dismissal from Trinity University. 

                                                                                             Print Name  __________________________

                                                                                              Signature   __________________________


Recursive Strings Lab
Individual Assignment
15  Points


Set Netscape Margins [ Left = 1; Right = .2; Top = .6; Bottom = .6; Select Document Title, Location,  Page Number, Page Total Black Text l]


1] The main program is complete and shown below. Your job is to provide the missing modules.  Call the Main Program   RecursiveStrings.cpp
 
///////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////
//                                                                              //
//                            RecursiveStrins.cpp                               //
//                                                                              //
//  Purpose    :                                                                //
//                                                                              //
//  Written By :                                      Environment :             //
//  Date       :                                      Compiler    :             //
//////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////

// ----------------------------------- Includes ----------------------------------
# include <iostream.h>
# include <iomanip.h>
# include <string.h>

long int StrLen (char String[]); // Recursive --> same functionality as strlen
void StrOut(char String[], bool CarriageReturn = false);
void StrCopy(char NewStr[], char CopyStr[]); // Recursive or Iterative -->same 
                                             // functionality as strcpy

main (int argc, char * argv[])
{
char
 Name[100],
 Str[100];

   cout << "-------------------------------------------------------------------\n";   
   cout << "--------------------- Recursive String Lab ------------------------\n";   
   cout << "------------------------- Written By ------------------------------\n";   
   cout << "---------------------------???????? -------------------------------\n";   
   cout << "-------------------------------------------------------------------\n\n\n";   
   cout << "############################### Start of Main #####################\n";

   cout << "Enter Your Full Name : ";
   cin.getline(Name, 99);
   cout << "strlen(Name)          = " << strlen(Name) << "\n\n";
   cout << "\n\n\n";

   cout << " \n------------------ Test Strlen -------------------------\n\n";

   cout << "StrLen('Christmas')   = " << StrLen ("Christmas") << endl;
   cout << "StrLen('First Noel')  = " << StrLen ("First Noel") << endl;
   cout << "StrLen('CSCI 1320')   = " <<  StrLen ("CSCI 1320") << endl;
   cout << "StrLen(Name)          = " << StrLen (Name) << endl;
   cout << "StrLen('')            = " << StrLen ("") << endl << endl << endl;
   
   cout << " \n------------------ Test StrOut -------------------------\n\n";
   StrOut ("Christmas", true);
   StrOut ("Good");
   StrOut ("Day");
   StrOut ("Mate", true);
   StrOut (Name, false);

   cout << " \n------------------ Test StrCopy ------------------------\n\n";
    StrOut (Name, "Einstein");
   cout << "Name [Einstein]               = " << Name << endl;
   StrOut (Name, "");
   cout << "Name []                       = " << Name << endl;
   StrOut (Name, "Alexander Graham Bell");
   cout << "Name [Alexander Graham Bell]  = " << Name << endl;
   StrOut (Name, "Doc");
   cout << "Name [Doc]                    = " << Name << endl;

   cout << "############################### End of Main #####################\n";
   
   return (0);
}

long int StrLen (char String[]) // same functionality as strlen
{
    return (0);
}
 

void StrOut(char String[], bool CarriageReturn) 
{
    if (String[0] == 0)
    {
        if (CarriageReturn)
            cout << endl;
    }
    else
    {
        cout << String[0];
        String++; 
        StrOut(String, CarriageReturn);
    }
}

void StrCopy(char NewStr[], char CopyStr[]) // same functionality as strcpy
{

}

2] Document the program. Replace the ???? with your name!

3] Write functions StrLen and StrCopy without calling any standard C++ functions.  You may call your own functions. StrLen must be recursive. Extra credit if StrCopy is recursive.

4]Do the following when program is complete.

g++ RecursiveStrings.cpp -o RecursiveStrings <-- Binary File Will Be Called RecursiveStrings - Not a.out
RecursiveStrings > Output.txt <-- Runs the program and dumps output into file Output.txt


4] Copy files RecursiveStrings.cpp  and  Output.txt to a floppy disk.Copy files RecursiveStrings.cpp  and  Output.txt to a second  floppy disk. Keep one of these disks as a backup.


5] Those Labs labeled "Individual Assignment" are to be done separately by each individual. Using a pen,  each individual is to print  his/her name at the top of this document in the space provided and sign it.  Those Labs labeled "Team Assignment" may be done as a team or individually. Using a pen,  each individual on the team is to print print his/her name at the top of this document in the space provided and sign it. Submit only one copy of team assignments!

Include the following in your wire-band binder:

A] Divider

B] Copy of this assignment sheet. Using an ink pen, print your name and sign this lab at the top.

C] Listings  RecursiveStrings.cpp  and  Output.txt

D] Disk Containing  RecursiveStrings.cpp  and  Output.txt

E] Divider