Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ please follow all requirements PigLatin.cpp Due Feb 17th 9am (before class) Program Description: This is a not an ordinary Pig Latin. Write a program

C++ please follow all requirements
image text in transcribed
image text in transcribed
image text in transcribed
PigLatin.cpp Due Feb 17th 9am (before class) Program Description: This is a not an ordinary Pig Latin. Write a program that reads a sentence as input and converts each word from English to "Pig Latin". In this version, to convert a word to Pig Latin you would follow the following steps: lising in.get (), strlen(), streats, stropy if needed. Using include 1. First convert the sentence to upper case, 2. Find the substring 'ig" (regardless of case). If there is one, remove the rest of the sentence include "ig. 3. And then you append the c-string 'ay (in lower case) to the end of the sentence. 4. Append the length of the sentence to the end. S. Now covert the sentence back to lower case Here are some examples: night English: Pig Latin: nay3 English: Pig Latin: night nay3 English: No "I-G" here Pig Latin: no "l-ghereay17 * notice in the last example, 1-G is NOT continuous, so it not the same as "IG" Repeat until user has entered a "QUIT" (regardless of case). You are required to use c-strings for this program Functions: Main function should be shorter than half a page. Explanation Function header This function should covert the given c-string to upper cases void convert Toupper(char* str) This function should covert the given c-string to lower cases void convert Tolower(char str) void findAndRemove(char* str) This function should find the substring "IG" in the giveno-string, and remove the rest of the c-string include "IG" This function should only be called when you have successfully removed "G" and the remaining string. Append a "ay (lower case) towards the end of the c-string void appendly(char wid convert Platin(charest) This function should provide a do-while loop (or a while loop to convert user input to upper case first, then calls "EndAnd Remove and appendAy in that order. Notice your program should stop as soon as user has entered a "quit message regardless of the casele Ouit is acceptable, but not "Quitting or "Quiti") Display a message "Ouitt" when the process is finished. Hints: 1. "ay will be attached to the end of the c-string regardless 2. No inputs are longer than 180 characters, guaranteed. 2 No Input validation needed. (everything and anything has a corresponding interpretation in Pip Latin) 4. When user enters "quit" (regardless of case), you should display a message "Quit!" Sample Output: Please enter a string, enter quit to stop the process night nay3 Please enter a string, enter quit to stop the process niGHT nay3 Please enter a string, enter quit to stop the process No "G-H" here no "g-h" hereay17 Please enter a string, enter quit to stop the process First they ignore you, then they laugh at you, then they fight you, then you win, first they ay13 Please enter a string, enter quit to stop the process then they fight you, then you win. then they fay13 Please enter a string, enter quit to stop the process Over overay6 Please enter a string, enter quit to stop the process Quit! quitlay7 Please enter a string, enter quit to stop the process Quit Quit! Other requirements: 1. C-stringis) 1 Costringsl should be dynamically allocated. All memory dynamically allocated should be fred ocated should be freed as soon as you are finished with a task. 2. Use functions as provided in the section above, Functions should not be modified 3. Follow programming style guideline very carefully, a. Points will be taken off for all violations 4 Your output style has to match with my output shown below (although you can try different below (although you can try different user input). 5. When accessing array, use only pointer syntax. You should only use ptr or ptr for accessing mer addresses or values. You cannot use 1) 6. NO global variables permitted 7. All functions must have prototypes. 8 Store all values as variables, do not hardcode any values (for example: size should be saved as a variable Use constant variables as much as possible a. const int SIZE - 81; 9. Use a line separator between all function definitions. /**** 101stars *****blank line before and after 10. All assignments must be submitted and run as specified to pass the course (see syllabus) 11. Copy and paste your output at the end of your program. Comment out the output lines. 12. Submit your program (.cpp only) on world classroom before deadline 13 Usi

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Sql++ For Sql Users A Tutorial

Authors: Don Chamberlin

1st Edition

0692184503, 978-0692184509

More Books

Students also viewed these Databases questions