#include #include #include #include #include #include void testConstructors(); void testAssignment(); void testAccessors(); void testIndexing(); void testModifiers(); void testgetline(); void testComparisons(); void testConcat(); void testSort(); void selectionSort(apvectorlist); void testExtract(); int main() { testConstructors(); cin.get(); testAssignment(); cin.get(); testAccessors(); cin.get(); testIndexing(); cin.get(); testModifiers(); cin.get(); testgetline(); cin.get(); testComparisons(); cin.get(); testConcat(); cin.get(); testSort(); cin.get(); testExtract(); return 0; } void testConstructors() { apstring word1(""); apstring word2("Hello world\0"); apstring word2("Hello world\n"); cout<<"Testing constructors"< word3"<list) { int flag; apstring temp; apstring temp2; for (int outer=0; outer < 5; outer++) { flag = outer; for (int inner=outer+1; inner<=4; inner++) { if (list[inner][0] < list[flag][0]) { flag = inner; } } temp = list[outer]; temp2 = list[flag]; list[outer] = temp2; list[flag] = temp; } for (int a=0; a<5; a++) word1[a] = list[a]; } void testExtract() { apstring word1 = "hello world"; apstring word2 = "hello"; apstring word3 = "programming is fun"; apstring word1a = "", word2a = "", word3a = ""; cout<<"Testing extracting first word"<