Question: For this problem, add your code to the strings.cpp file. (a) Write a C++ program that prompts the user to input two character arrays (or

For this problem, add your code to the strings.cpp file. (a) Write a C++ program that prompts the user to input two character arrays (or strings). Store them in variables str1 and str2. You can assume that the strings do not include whitespaces. (b) Print the lengths of the two strings (one option is to use the strlen function). (c) Check if str1 is a substring of str2. Print a Yes/No answer. Examples: o str1 = hi str2 = WellhiThere! true o str1 = Joseph str2 = JosephBiden true o str1 = aaa str2 = 89aaa true o str1 = ac str2 = abc false o str1 = abc str2 = a_b_c false o str1 = hi_there! str2 = hi false o str1 = a str2 = AA false Notes: In the fourth example, the characters a and c in str1 appear also in str2; however, the string ac does not appear as a whole in str2 and so the answer should be false; the same applies for the fifth example. In example 6, str2 is a substring of str1, but the answer is false because the question is whether str1 is a substring of str2 (not the opposite). Finally, in the last example, small a and capital A are different characters, so the answer is false. (d) (Do not start coding before you read this question fully including the note at the end) For each of str1 and str2, check if the following two conditions are satisfied (print a Yes/No answer): 1. The string is symmetric (it reads the same forward and backward) 2. All the characters are vowel letters. To check if a character is a vowel letter, you can use the isVowel function that is provided in the strings.cpp file; for example, isVowel(A) gives true, while isVowel(B) and isVowel(,) give false. Your function should return true if both conditions are satisfied, and return false otherwise. Examples: o A true (symmetric and a vowel) o aOOa: true (symmetric and vowels) o ouie false (vowels but not symmetric) o Eiou5uoiE: false (symmetric but 5 is not a vowel) o aB: false (not symmetric and also B is not a vowel)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!