// CS212 HW #6: hw6.cpp // // Due: April 2, 2008 // // Author: Amy Yurksaitis // // Instructor: Dr. Wang // // Goal: This program will allow the user to input a string, // find a string, print the string list, sort the list // to ascending order, and quit. // // Compile: g++ hw6.cpp -o hw6.out // Run: ./hw6.out ///////////////////////////////////////////////////////////////////////////// #include #include using namespace std; const int MAX = 100; class List { int length; string name[MAX]; public: List () { length = 0; } int Length ( ) const { return length; } bool IsFull ( ) const { return ( length == MAX ); } bool IsEmpty ( ) const { return ( length == 0 ); } void Print ( ) const; void Insert ( string item ) { name[ length ] = item; length ++; } bool IsPresent ( string item ) const { bool done = false; for ( int k=0; k name[k]) minIndex=k; } temp = name[minIndex]; name[minIndex] = name[passCount]; name[passCount] = temp; } } }; void List:: Print() const { for(int k=0; k> ch; while ( tolower(ch) != 'q' ) { process(ch, myList); menu(); cin >> ch; } getchar(); return 0; } void menu () { cout << "\n\n==========================================\n\n" <