String Manipulation
or HW 3, you should use a main() function to control the program you write. You should also use other functions as appropriate (or as specified).
String Manipulation – Write a program that asks the user to enter a word or phrase and then displays the word or phrase with all occurrences of the letter “r” removed. Example: “Park the car in Harvard Yard” becomes “Pak the ca in Havad Yad.”
Special Number – Write a program that can find a four-digit number that has the four digits reversed when multiplied by four. For example, rstu * 4 = utsr. The program should report the number to the user.
Check for Palindromes – Write a program that prompts the user to enter a word or phrase. Then check to see if the word is a palindrome. A palindrome reads the same forward and backward ignoring punctuation and spaces. For example, “racecar,” “Madam, I’m Adam,” and “Anna.” You can use these palindrome sentences (Links to an external site.) as a source for checking if your program works.
Calculate the Factorial – The factorial of a positive integer is the product 1 * 2 * 3 * 4 … * n where n represents the positive integer. Write a program that asks the user to enter a positive integer and calculates the factorial. Use a main() function to control the program flow. Write a function to get an integer from the user and verify the user entered a positive integer value. Write a different function to calculate the factorial for a number.