Question: C++ Programming: Overview: You are put in charge of a secret project to decrypt some classified documents. You have discovered that the documents were encoded

C++ Programming:

Overview: You are put in charge of a secret project to decrypt some classified documents. You have discovered that the documents were encoded in a super-secret code called Pig Latin. In this project you will be writing a program to take in some pig-latin encoded text and decode it into English.

Note: While there are many ways to do this conversion, I will require that you follow the procedures below, all of which will use the following structure:

struct Word { string pigLatinWord; string englishWord; };

Part 1: Write a function that takes in a c++ string of text. This function should first calculate how many words are in the sentence (words being substrings separated by whitespace). It should then allocate an array of the structure Word of this size (so large enough to hold the sentence). It should then store each of the words in that sentence to the array of structures in the pigLatinWord field as we will be starting with a sentence of pig latin words. The function should then return this array to the calling function with a return statement, along with a size through a reference parameter. That is, you will break up the input string by spaces and input each separate word into one component of the array.

Note: This function should also remove all capitalization and special characters except for the very end period, exclamation mark or question mark. I am requiring you to do this using the C++ string member functions by using .find() to find a space, then cutting the string up using the .substr(x,n) member function. You will probably need to use .length and some other member functions.

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!