Question: Please give the correct code, in type the full code. 8.7: Igpay Atinlay Write a program that inputs two string variables, first and last, each

Please give the correct code, in type the full code.
 Please give the correct code, in type the full code. 8.7:
Igpay Atinlay Write a program that inputs two string variables, first and

8.7: Igpay Atinlay Write a program that inputs two string variables, first and last, each of which the user should enter with his or her name. First, convert both strings to all lowercase. Your program should then create a new string that contains the full name in pig latin with the first letter capitalized for the first and last name. The rules to convert a word into pig latin are as follows: . If the first letter is a consonant, move it to the end and add "ay" to the end. If the first letter is a vowel, add "way" to the end. . For example, if the user inputs "Erin" for the first name and "Jones" for the last name, then the program should create a new string with the text "Erinway Onesjay" and print it. SAMPLE RUN #1: ./ETest Interactive Session Enter your first name: Barak Enter your last name:OBAMA Your name in pig latin is: Arakbay OBAMAway 9.2: Delete Repeats, Again Do Programming Project 3 in Chapter 7. In this version of the problem, return a new dynamic array where all repeated letters are deleted instead of modifying the partially filled array. Don't forget to free the memory allocated for these returned dynamic arrays when the data is no longer needed. For your convenience, the project 3 instructions from Chapter 7 are repeated here: Write a function called delete_ repeats that has a partially filled array of characters a a formal parameter and that deletes all repeated letters from the array. Since a partially filled array requires two arguments, the function will actually have two formal parameters: an array parameter and a formal parameter of type int that gives the number of array positions used. When a letter is deleted, the remaining letters are moved forward to fill in the gap. This will create empty positions at the end of the array so that less of the array is used. Since the formal parameter is a partially filled array, a second formal parameter of type int will tell how many array positions are filled. This second formal parameter will be a call-by-reference parameter and will be changed to show how much of the array is used after the repeated letters are deleted For example, consider the following code: char a[10]; a[0] 'a' a[2] 'a; int size-4; delete_repeats(a, size); After this code is executed, the yalue of a[O] is 'a', the yalue of a[1] is 'b', the yalue of a[2] is 'c', and the value of size is 3. (The value of a[3] is no longer of any concern, since the partially filled array no longer uses this indexed variable.) You may assume that the partially filled array contains only lowercase letters. Embed your function in a test program that reads all the characters on a line (up to but and including the newline character) and stores all of them EXCEPT the newline character in an array. Assume no more than 80 characters per line. The test program keeps count of the number of characters actually stored in the array The test program prints out the number of characters stored and then prints out the characters on a single line twice. The program then passes the array to the function delete_repeats and now prints the characters effectively stored in the array on a ingle line followed by the number of characters that are effectively stored in the array Input/Output Notes: There are no prompts or labels. Here is a use case example where the input was "abra cadabra": abra cadabra 12 abra cadabra abra cadabra abr cd

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!