Write a program called palindrome.epp. The program should have the two functions listed below. Your program should loop until the user enters "quit". The determination of a word being a palindrome or not should be case insensitive. void getWord ( string& word ) : This function is responsible for getting the word from the user. void isPalindrome ( string& word, bool& result ): This function is responsible for determining if a word is a palindrome or not. It will return true if the word is a palindrome and false if the word is not a palindrome using a boolean variable passed by reference. Sample Output 1 What is the word? Kayak Kayak is a palindrome

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter9: Records (struct)
Section: Chapter Questions
Problem 2PE
icon
Related questions
Question
Write a program called palindrome.cpp. The program should have the two functions listed
below. Your program should loop until the user enters “quit". The determination of a word being
a palindrome or not should be case insensitive.
void getWord ( string& word ): This function is responsible for getting the word from
the user.
void isPalindrome ( string& word, bool& result ): This function is responsible
for determining if a word is a palindrome or not. It will return true if the word is a palindrome
and false if the word is not a palindrome using a boolean variable passed by reference.
Sample Output 1
What is the word? Kayak
Kayak is a palindrome
Sample Output 2
What is the word? APPLE
APPLE is not a palindrome
Notes
• Remember that you can access each character in a string by using the index operator, i.e.,
word[3], and the highest index of any string is the length of the string minus one.
• To handle the case-insensitivity part you may need to work with functions that change the case
of letters in a string.
Transcribed Image Text:Write a program called palindrome.cpp. The program should have the two functions listed below. Your program should loop until the user enters “quit". The determination of a word being a palindrome or not should be case insensitive. void getWord ( string& word ): This function is responsible for getting the word from the user. void isPalindrome ( string& word, bool& result ): This function is responsible for determining if a word is a palindrome or not. It will return true if the word is a palindrome and false if the word is not a palindrome using a boolean variable passed by reference. Sample Output 1 What is the word? Kayak Kayak is a palindrome Sample Output 2 What is the word? APPLE APPLE is not a palindrome Notes • Remember that you can access each character in a string by using the index operator, i.e., word[3], and the highest index of any string is the length of the string minus one. • To handle the case-insensitivity part you may need to work with functions that change the case of letters in a string.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Function Arguments
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning