Question: Lab 12 Palindrome Program CSCI 111 Programming and Algorithms I Due Sunday February 21, 11:59pm on turnin 10 Points NEW CONCEPTS: Successful completion of this
Lab 12
Palindrome Program
CSCI 111 Programming and Algorithms I
Due Sunday February 21, 11:59pm on turnin
10 Points
NEW CONCEPTS: Successful completion of this lab incorporates the following new concepts.
#include
string word;
int wordlen;
wordlen = word.size();
Task list:
1. Create a source code file named lab12.cpp.
2. Start by prompting the user for a word and saving it into a variable of type string.
3. Determine if the word is a palindrome. Start by checking the first and last letter of the word and work your way towards the center of the word. The program should accept both, odd and even number of letters per word.
4. The script should display whether the word is a palindrome or not.
5. Refer to the expected output listing below.
6. Submit your lab12.cpp file on https://turnin.ecst.csuchico.edu/ and get a successful message. GRADING
To achieve a maximum score, students will need to clearly prove that they completed the goal.
Points lost for incompleteness, sloppiness, lateness, or failure to follow instructions.
Refer to syllabus for late policy.
SAMPLE OUTPUT
/user/faculty/jraigoza/CSCI111/Labs/lab12 $ ./lab12
Please enter a word.
hanah
The length of the word is 5.
Checking element 0 with element 4.
Checking element 1 with element 3.
YES: it is a palindrome.
/user/faculty/jraigoza/CSCI111/Labs/lab12 $ ./lab12
Please enter a word.
hannah
The length of the word is 6.
Checking element 0 with element 5.
Checking element 1 with element 4.
Checking element 2 with element 3.
YES: it is a palindrome.
/user/faculty/jraigoza/CSCI111/Labs/lab12 $ ./lab12
Please enter a word.
book
The length of the word is 4.
Checking element 0 with element 3.
NO: it is not a palindrome.
/user/faculty/jraigoza/CSCI111/Labs/lab12 $ ./lab12
Please enter a word.
house
The length of the word is 5.
Checking element 0 with element 4.
NO: it is not a palindrome.
/user/faculty/jraigoza/CSCI111/Labs/lab12 $
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
