Question: In C++ please Write a function insert that takes four parameters, in this order: an array of characters, the number of characters currently in the

 In C++ please Write a function insert that takes four parameters,in this order: an array of characters, the number of characters currently

In C++ please

Write a function insert that takes four parameters, in this order: an array of characters, the number of characters currently in the array, the total size of the array and the number of vowels in the array. The function should traverse the character array, and when it finds a vowel it should insert the same vowel directly after it in the array. The function should return the new number of characters in the array. If the array is already full or if the number of characters that need to be added in the array exceeds the total size of the array, the array should remain unchanged. Assume all inputs are lowercase alphabets. o Function specifications: The function name: insert The function parameters (in this order): An array, char[] The number of characters stored in the array, int The size of the array, int The number of vowels in the array, int The function returns the total number of characters in the array after the insertion. O O o Sample run 1 Testi: cat, 3, 5, 1 String after insertion: caat Sample run 2 Testi: interesting, 11, 16, 4 String after insertion: iinteereestiing Sample run 3 Testi: boulder, 7, 9, 3 String after insertion: boulder

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!