Question
code in c++ 1) Write a function that takes as an input parameter a string and the length of the string (for the second parameter,
code in c++
1) Write a function that takes as an input parameter a string and the length of the string (for the second parameter, use call by reference). It then goes through the string, character by character. If the character is a vowel, it concatenates ithag as well as the vowel. Otherwise it just concatenates the letter to the new string. It modifies the length parameter to the new string length, The function should return the new string. You should make at least 1 test case, and when the function is finished, print out both the new string and the new length. In the test case, do not have the user type in the string-- define in the test case what string is going to be used (ex: string x="cat")
Examples:
Cat, 3 -> cithagat, 8
Cover, 5 -> cithagovithager, 15
Balsamic, 8 -> bithagalsithagamithagic, 23
Note: for this lab well consider y a vowel.
(Now you are creating the gibberish language)
NOTE: you can convert a character to a string using string(1,s[0]), for example
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