Question
How can I modify my code (see below) to meat the a and b requirements?: a) Modify the function that removes ignores non-letters (i.e., the
How can I modify my code (see below) to meat the a and b requirements?:
a) Modify the function that removes ignores non-letters (i.e., the one that removes spaces and special characters from a string). You have probably defined this as a void-function since it does not need to return any value. Your task is to change the function so that it now returns how many characters that were removed by the function (or 0 if no character were removed). (2p) b) Modify main() so that it displays information of how many characters were removed in order to verify if it was a palindrome. See the example run how this could be displayed (2p)
Example run (user input inbold,comments not partof the output initalic): Enter a sentence: A lemon one space will be removed This sentence is not a palindrome. 1 character(s) were removed. Do you want to enter another sentence (0 for no, 1 for yes)? 1 Enter a sentence: No lemon, no melon. three spaces and two special characters removed This sentence is a palindrome. 5 character(s) were removed. Do you want to enter another sentence (0 for no, 1 for yes)? 0
My code:
#include
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