Name: _____________________________ Honor Code Acknowledgment: ________________________ Random Quiz # 10 CPS 08, Spring 1995 February 27, 1995 Problem 1 : itspinsay As part of a language translation program you have been asked to write a fucntion that will create a string by removing the first letter and making it the last letter. This function, named Pigify, should work so that cout << Pigify("slip") << endl; will print "lips", i.e., the function returns a string. String Pigify(const String & word) // precondition: word = a1a2a3...an // postcondition: returns a2a3...ana1 // // this function creates and returns a string based on word // by 'rotating' the characters of word and making the first the last You should write two versions of the function. One version should use the indexing operator [] to access characters and the concatentation operator + to build up the new string. The other version must work without using the indexing operator, but by using istrstream, GetLine, and get (you can still use the concatenation operator +). In both functions you'll need a loop that does something like: String result = ""; // initialize to empty string while (...) { result += appropriate_character; } return result;