Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++, please follow and run the program Piglatin.cpp Due Feb 17th 9am (before class) Program Description: his is a not an ordinary Pig Latin. Write

C++, please follow and run the program
image text in transcribed
image text in transcribed
image text in transcribed
Piglatin.cpp Due Feb 17th 9am (before class) Program Description: his 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: using cin.get (), strlen(l, streats, stropy if needed. Using include 1. First convert the sentence to upper case, restring> 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 string 'ay (in lower case) to the end of the sentence 4. Append the length of the sentence to the end. 5. Now covert the sentence back to lower case Here are some examples: night English: Pig Latin: nay3 English: Pig Latin: nlGht nay3 English: No "1- G here Pig Latin: no "i - g" hereay17 * 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 cader This function should covert the given c-string to upper cases void convert Toupper(char* str) str) This function should covert the given c-string to lower cases void convert Tolower(char void findAnd Remove(char* str) This function should find the substring "IG" in the given c-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: All memory dynamically allocated should be freed as soon as 1. C-string(s) should be dynamically allocated. All memory dynamically allocated you are finished with a task. 2. Use functions as provided in the section above, Functions should on 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 5. When accessing array, use only pointer syntax. You should only use ptr or ptr for accessir addresses or values. You cannot use 0 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

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

Introduction To Database And Knowledge Base Systems

Authors: S Krishna

1st Edition

9810206208, 978-9810206208

More Books

Students also viewed these Databases questions