Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Lab 19 Due Date: See Blackboard Source File: /2336/19/lab19. (CICPP I cpplc++lcclcxxlcp) Input: Output Value: under control of main function under control of main function
Lab 19 Due Date: See Blackboard Source File: /2336/19/lab19. (CICPP I cpplc++lcclcxxlcp) Input: Output Value: under control of main function under control of main function Write a recursive boolean function that determines if a string is a palindrome. A palindrome is a word, verse, or sentence that is the same when read backward or forward. A sample main function for testing your function is shown in Figure 1. Commands to compile, link, and run this assignment are shown in Figure 2 Your function should perform comparisons in a case-insensitive manner. To use the Makefile as distributed in class, add a target of lab19 to targets2srcfiles #include #include #include #include 4 6 using namespace std; 8 / isPalindrome is a recursive function that returns true if string s I/ is a palindrome and false othervise bool isPalindrome (string s); 2 // rmPuncSpaces returns string s with all punctuation and whitespace 14 string rmPuncSpaces (string s); 6 int mainO) characters removed string str; while (getline(cin, str)) 20 cout ./getlab.ksh 19 * Checking to see if a folder exists for Lab 19..No Creating a folder for Lab 19 Checking to see if Lab 19 has sample input and output files. . .Yes 6Copying input and output files for Lab 19 from folder /usr/local/2336/data/19 to folder/19 Checking to see if /usr/local/2336/src/lab19main.C exists. . .Yes Copying file /usr/local/2336/src/lab19main . to folder ./19 9 * Checking to see if /usr/local/2336/include/lab19.h exists. . .No u1Copying file /usr/local/2336/src/Makefile to folder./19 12Adding a target of lab19 to targets2arcfiles * Touching file . /19/1ab19.cpp 14*Edit file /19/lab19.cpp in Notepad++ s newuser csunix /2336> cd 19 newuser@csunix /2336/19> 1s 01.dat 01.out Makefile lab19.cpp lab19main.c newuser@csunix /2336/19> make lab19 9 g++ -g -Wall-std-c++11 lab19main.C -I/usr/local/2336/include I 20 g++ -g -Wall -td c++11 - lab19.cpp -I/usr/local/2336/include -I 21 gt+ -o lab19 lab19main.o lab19.o -L/usr/loca1/2336/lib -1m -lbits 22 newuser@csunix /2336/19 cat 01.dat 231996 2 bottle 25 12345 26 radar a a Toyota as Madam, I'm Adam 29 Was it a rat I sau? so Norma is as selfless as I am, Ron si A man, a plan, a canal--Panama! 32 Tarzan raised Desi Arnaz rat newuser@csunix /2336/19> cat 01.dat ./lab19 4 1996 is not a palindrome as bottle is not a palindrome 36 12345 is not a palindrome r radar is a palindrome as a Toyota is a palindrome 3 Madam, I'm Adam is a palindrome o Was it a rat I saw? is a palindrome 41 Norma is as selfless as I am, Ron. is a palindrome 42 A man, a plan, a canal--Panama! is a palindrome 43 Tarzan raised Desi Arnaz' rat. is a palindrome nevuser csunix /2336/19> cat 01.dat I/lab19 > my.out 4 newuser@csunix /2336/19> diff 01.out my.out 46 newuser csunix /2336/19> Figure 2. Commands to Compile, Link, & Run Lab 19
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started