Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

C++ For this assignment, we will move on to Chapter 8. In this chapter, we learn

ID: 3918144 • Letter: C

Question

C++

For this assignment, we will move on to Chapter 8. In this chapter, we learn about using strings and string conversions in our coding. Obviously as you know, using and manipulating strings in any kind of code, whether it be command line coding or full on object oriented programming is a definite task. For this assignment, your program needs to ask the user to input a string or a sentence. When the user presses enter, the program will display the same sentence spelled backwards. That is all we really need to do. Fairly simple week this week. Now, for the extra credit. To get 5 points extra credit, do the above programming. At the end of your program though, program a check in the code to check to see if the sentence is a palindrome. This means that when you take the sentence and reverse it, it will spell the same thing. Tell me if the sentence is a palindrome or not. If you can successfully tell me that, I will give you 5 points extra credit. Since extra credit is just that...extra credit, I cannot provide help for the extra credit. I can provide help for the assignment. Good luck! Here is an example of the completed program without the extra credit. c: Documents and Settings Wdministrator Desktop DESKTOPLAngellSpring 20131C Programming Week 8Week8Debug... -ax nter a line of text: This is a test sentence for C Progranning,. This sane sentence printed backwards is: gninnargorP Crof ecnetnes tset a si sihI

Explanation / Answer

#include #include using namespace std; string reverse(string str) { string s = ""; for(int i = str.length()-1; i >= 0; --i) { s += str[i]; } return s; } int main() { string s; cout