Question: Create a C + + file with the name problem 3 . cpp . Write the function bookEndString, which has a string s and an
Create a C file with the name problemcpp
Write the function bookEndString, which has a string s and an integer r as parameters, permanently modifying the string s If the first and last letters of the string are the same, then add r copies of that letter to the beginning and ending of the string. Otherwise, add r Zs to the beginning and ending of the string. The return type for this function is void.
Write the main function that does the following:
Prompt the user for a string containing at least letters, validating the input until the user enters a string with at least letters.
Prompt the user for a positive integer, validating the input until the user enters a positive integer.
Call the function bookEndString passing into it the string and the integer.
Print the modified string.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
