Lab 24

  1. Write a complete C++ program that does the following:
  2. Example main function that uses these functions:
    int main() { string name; cout << "Enter your name: "; cin >> name; cout << "String in reverse:\n"; printReverseString(name); cout << "Current value of name:\n"; cout << name << endl; reverseString(name); cout << "Current value of name:\n"; cout << name << endl; return 0; }

    Sample run of program:
    Enter your name: Danny String in reverse: ynnaD Current value of name: Danny Current value of name: ynnaD
  3. Write a complete C++ program that does the following:
  4. Example main function that uses these functions:
    int main() { string s; cout << "Enter a word: "; cin >> s; lowerCaseString(s); cout << "Fully lower case:\n"; cout << s << endl; upperCaseString(s); cout << "Fully upper case:\n"; cout << s << endl; undulatingString(s); cout << "Undulating case:\n"; cout << s << endl; return 0; }

    Sample run of program:
    Enter a word: Mathematics Fully lower case: mathematics Fully upper case: MATHEMATICS Undulating case: mAtHeMaTiCs
  5. Write a complete C++ program that does the following:
  6. Example main function that uses printStripedSquare:
    int main() { char a, b; int x, y; cout << "Enter two characters, first must precede second in alphabetical order: "; cin >> a >> b; x = (int) a; y = (int) b; while(FILL IN){ FILL IN } printStripedSquare(a, b); return 0; }

    Sample run of program:
    Enter two characters, first must precede second in alphabetical order: t r Invalid input! First character must precede second in alphabetical order! r t rrrrr ttttt rrrrr ttttt rrrrr