// Program file: testib.cpp #include #include "boolean.h" #include "strlib.h" int main() { string word1, word2, number; cout << "Testing strlib functions." << endl << endl; cout << "Testing string_equal." << endl; cout << "Enter two different words several times, " << "and then two identical words." << endl << endl; do { cout << "Enter the first word: "; cin >> word1; cout << "Enter the second word: "; cin >> word2; } while (! string_equal(word1, word2)); cout << "Testing make_uppercase." << endl; make_uppercase(word1); cout << word1 << endl; cout << "Testing is_integer." << endl; cout << "Enter several bad representations of integers," << endl; cout << "and then a good one." << endl << endl; do { cout << "Enter an integer: "; cin >> number; cout << "The integer is " << number << endl; } while (! is_integer(number)); cout << "Testing to_integer." << endl; cout << "Enter several good representations of integers," << endl; cout << "and then a bad one." << endl << endl; cout << "Enter an integer: "; cin >> number; while (is_integer(number)) { cout << "The integer is " << to_integer(number) << endl; cout << "Enter an integer: "; cin >> number; } cout << "Testing completed." << endl; return 0; }