/* Matthew Giampiccolo & Jason M. Snouffer Computer Science & Programming Wednesday, November 6, 2002 Lab 10 Problem 6 This program utilizes the string class to recieve a string from a user and then determine whether it is a palendrom or not. Test Suite: Input: aba Expected Output: aba is a palendrome Input: computer science Expected Output: computer is not a palendrome Input: poop Expected Output: poop is a palendrome Input: Rowan Expected Output: Rowan is not a palendrome Input: abbbaabbba Expected Output: abbbaabbba is a palendrome Input: 11113 Expected Output: 11113 is not a palendrome Input: 11211 Expected Output: 11211 is a palendrome Input: word Expected Output: word is not a palendrome All of the sample inputs within this test suite were tested and performed as expected. */ #include #include #include using namespace std; /***********************************************Function Prototypes******************************************************* int length(); // returns the length of "this" string char at(int position); // returns the character in location position. Note that the first position is 0!!!! /*************************************************Main Function**********************************************************/ int main() { int string_length; bool palendrome_validity; //this value will indicate if string is a palendrome string s1; cout<<"Please enter a string: "; cin>>s1; string_length = s1.length(); //string_length gets the length of string s1 int i(0), j = string_length; do { j--; if ( s1.at(i) == s1.at(j) ) { palendrome_validity = true; } else { palendrome_validity = false; } i++; } while ( (i < string_length) && (palendrome_validity == true) ); /* Loop will continue as long as int i is less than the string length and the strings palendrome status has not been proven false yet. */ if (palendrome_validity) { cout<