#include #include using namespace std; void printCaps(string str); int main45435() { // Get input string fname, lname; cout << "Enter name: " << endl; cin >> fname >> lname; // Output last name, capitalized printCaps(lname); cout << ", "; printCaps(fname); return 0; } void printCaps(string str) { // change all characters to uppercase for (int i=0; i < str.length() ; i++) { // change chars to capitals if ( (str[i] >= 'a') && (str[i] <= 'z') ) { str[i] = char(str[i] - 'a' + 'A'); } } cout << str; } void printCapsOld(string str) { for (int i=0; i < str.length() ; i++) { // Output each character, capitalized if ( (str[i] >= 'a') && (str[i] <= 'z') ) { cout << char(str[i] - 'a' + 'A'); } else { // not lowercase, just output char cout << str[i]; } } }