Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

C++ must use: insert(size_t pos, const string& str) replace(size_t pos, size_t l

ID: 3673772 • Letter: C

Question

C++ must use:

insert(size_t pos, const string& str)

replace(size_t pos, size_t len, const string& str)

struct Word {

string piglatin;

string english; };

Write a function in C++ that takes in a sentence of pig latin (All words starting with a consonant have first letter moved to the back and "ay" added (EX: Bank = ankbay) all words starting with a vowel have "way" added to the end (EX: elf + elfway) The function should calculate how many words(substrings seperated by whitespace) are in the sentence. It should allocate an array of the structure Word, and store each of the words in the sentence to the array of structures in the piglatin field. The function should return this array to the calling function with a return statement, along with a size through a reference parameter. This function should also remove capitalization and special characters except for the character at the end to mark the end of the sentence.

Write a function that takes in an array of Word structs and a maximum size which converts the pig latin field array to the english array.

Write a function that takes in an array of Word structs and prints the english translation on the screen, a space separating each word of the sentence.

Explanation / Answer

Hi below i have written a C++ code but here i have worked on a example program  that is supposed to convert English to Pig Latin, You can make that or call it in opposite way of excecution for your reference,

one more thing:
You might want to add
#include <cctype>
and then if the first letter is upper
if(isupper(something_here[at_some_place]))
then
something_here = tolower(something_here[at_some_place])

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote