Question: Write a program using C++ (nothing complicated just the using the basic C++ stuff) Computers have long been used to encode and decode messages. The


Write a program using C++ (nothing complicated just the using the basic C++ stuff)
Computers have long been used to encode and decode messages. The Caesar Shift Cipher from Homework I is one simple scheme that encodes each letler in a message separately. A simple scheme to encode words in a message is Pig Latin. For this assignment, we will translate English words in lowercase to a very simple form of Pig Latin. (Note: This is much simpler than a similar CS 210 assignment that you may or may not have completed.) There are only two ules: 1. If a word start with a vowel, simply append "ay" to the end of the word. Example: insect becomes insectay 2. Otherwise, remove the first letter of the word, append it to the end of the word, and then append "ay" Example: dog becomes ogday. Write a program in a file named piglatin.cpp that will read lines of text from a file. For each word in a line, the program will translate the word into Pig Latin and output it to a file. Assume that the input file meets the following specification: All characters are lowercase alphabetic characters or spaces. Le, there are no uppercase letters, digits, or symbols in the input . The first character in a line is not a space. .The last character of a line (ie, before the newline) is not a space. There is exactly one space between each word in a line. .There are no blank lines. The output file must meet the same specification. That is, the translated words of a line of input must appear in the same line in the output separated by one space and each line must end with a non-whitespace character and a newline. The program must be implemented using (at least) the following functions: A function that receives a C++string that is a line of words in all lowercase letters and passes back a string that is the Pig Latin translation of the word. Eg translate sentence english sentence, piglatin sentence) A function that receives a C++string that is a word in all lowercase letters and passes back a string that is the Pig Latin translation of the word. Eg translate word (english word, piglatin word) The idea is for the main program to read in lines of the file and call the translate sentence function, and for the translate sentence function to find the words in the line and call the translate word function and build up the translated sentence. Reminder: C++strings are defined in the
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
