// pgm31 // using the C++ string class + operator, [] operator, += // relational operators // 11/21/2016 #include #include #include #include #include using namespace std; int main() { string first, last, fullname; cout << "Enter first and last name: "; cin >> first >> last; fullname = last+','+first; cout << "fullname is: " << fullname << endl; string noun, single, example; cout << "enter a noun: "; cin >> noun; single=noun; // same as: noun = noun+"s"; noun += "s"; if (single==noun) cout << "same."; else cout << "not equal." << endl; // Wrong! assigning to a string literal //"S" += noun; cout << "Plural: " << noun << endl; cout << "iterate through elements of string and " << "change every e to i" << endl; for (int i=0; i> finished; } return 0; } LAB1 for Today: // Write a program to read in strings (loop) // If the length of the string is > 10 // print "that is long" // otherwise // print "thank you." // you decide when to terminate the loop.