Question: Assignment #4: Due: Fri. February 18 (11.59 PM) Program files: Code: a4_LastName.cpp Objective: Write a program that accepts a string as an input and perform
Assignment #4: Due: Fri. February 18 (11.59 PM) Program files: Code: a4_LastName.cpp Objective: Write a program that accepts a string as an input and perform following - Write a function that accepts a string as an argument and display the reverse of that string and return that string. Write another function that accepts a string as its argument and check whether the string is palindrome or not. Description: A palindrome is a string, which when read in both forward and backward ways is the same. Example: lol, pop, radar, madam, etc. To check if a string is a palindrome or not, a string needs to be compared with the reverse of itself. Demonstrate these two functions in a program that performs the following steps: 1. The user is asked to enter a string. 2. The program displays the following menu: A) Display the reverse of the string B) Check the string is palindrome or not C) Exit the program 3. The program performs the operation selected by the user and repeats until the user selects E to exit the program. Output: Enter a string : madam Please enter a choice according to menu: A) Display the reverse of the string B) Check the string is palindrome or not C) Exit the program Please enter choice: A
COSC 1560 Computer Programming II Assignment #4 The reverse of the string is : madam Please enter choice: B Madam is palindrome Please enter choice: E Terminate the program
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
