The program output is also shown below. #include #include using…

The program output is also shown below. #include #include using…

The program output is also shown below.

  1. #include
  2. #include
  3. using namespace std;
  4. char caesar(char);
  5. int main()
  6. {
  7. string input;
  8. do
  9. {
  10. cout
  11. cout
  12. getline(cin, input);
  13. string output = “”;
  14. for (int x = 0; x
  15. {
  16. output += caesar(input[x]);
  17. }
  18. cout
  19. }
  20. while (!input.length() == 0);
  21. } //end main
  22. char caesar(char c)
  23. {
  24. if (isalpha(c))
  25. {
  26. c = toupper(c); //use upper to keep from having to use two seperate for A..Z a..z
  27. c = (((c – 65) + 13) % 26) + 65;
  28. }
  29. //if c isn’t alpha, just send it back.
  30. return c;
  31. }