Question: Code in C++ please! 1) Write a function that takes as an input parameter a string and the length of the string (for the second

Code in C++ please!

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 3 test cases, and when the function is finished, print out both the new string and the new length.

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

2) Write a recursive function that converts a hex number(in the form of a string) to an integer.

NOTE: to convert a hex number to an integer, you must first know that A=10, B=11, C=12, D=13, E=14, and F=15. You must then know that you multiply each digit or number equivalent by 16 to the power of its location from the right. So, for instance, if the number is:

6A4C (hex value), to convert youd do the following:

Cx160 (or 12x160) + 4x161 + Ax162 (or 10x162) + 6x163 = 27212

Note that you may use a helper function for this (only if you need it). Only one of the functions neeed be recursive, but Note 2 applies to both functions.

Note2: Recursive rules apply the word for and the word while cannot appear either in the original or the helper function, and the recursive function must actually be recursive (Im so picky that way).

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!