Return to Topic Menu | Computer Science Main Page | MathBits.com | Terms of Use

Demo apstring class

//Demo for apstring class
#include<iostream.h>
#include<stdlib.h>
#include "apstring.cpp" //need this for strings

int main(void)
{
     system("CLS");
     apstring name, animal1, animal2, animal3;

     cout<<"\t\t\tTHE LIST OF UNUSUAL ANIMAL NAMES\n\n";

     cout<<"What is your name? ";
     getline(cin,name); //allows for full name containing spaces
     cout<<name<<", this program will allow you to enter 3 animal names";

     cout<<"\nPlease enter the first name: ";
     getline(cin,animal1);

     cout<<"\nPlease enter the second name: ";
     getline(cin,animal2);

     cout<<"\nPlease enter the third name: ";
     getline(cin,animal3);

     cout<<"\n\nWow, are those real names!!!";
     cout<<endl<<endl<<endl;

     return 0;
}
 

 

Return to Topic Menu | Computer Science Main Page | MathBits.com | Terms of Use