Program Assignment Background: We are all experiencing some significant inflation this year. When I walk up to the food
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
Program Assignment Background: We are all experiencing some significant inflation this year. When I walk up to the food
I WILL GIVE GOOD RATINGS
Program Assignment Background: We are all experiencing some significant inflation this year. When I walk up to the food carts around PSU, I notice that all of their menus have tape or hand written marks changing the prices of all of the menu items. The menus really look messy as a result. So, I thought we would create a program that would help a food cart owner print out a new menu when prices increase! Program Assignment Specifics: Your job is to design and create a program to allow for printing out a menu for a food cart business owner. There are some limitations to this process that your program will have to follow, since the menu items will need to fit on the sign outside of the food cart's window. Although the business owner will enter in all of the menu items and the prices, what is displayed will have to fit within a particular format to fit. Guidelines for the Menu: Your program will follow these guidelines: 1. Each menu item must fit within a 30 character field. If the menu item is longer, we don't want to just chop off the end. Instead, your program will want to remove words of "the" and "and" from what is displayed. 2. All punctuation should be removed 3. Also skip words that are only 1 or 2 characters long CS162 4. After all of these changes, if it is still longer than 30 characters, remove every other vowel working from the end and moving forward. Do not Summer 2022 Program #2
remove the vowel if it is the first character of a word. 5. After all of this, if it doesn't fit within 30 characters, tell the owner to re- enter their menu item! For example, if the food cart owner entered: A Black bean with curry and rice! After your program runs it will be: Black bean curry rice Here is another example that is longer: Follow these Tasks: Task 1. Task 2. Task 3. ● Task 4. Task 5. Owner enters: Tofu and egg noodles blended with spices and rice After your program runs it will be: Tof egg nodls blendd spics ric Task 6. ● Introduce the program to the user Ask for the menu item Prompt and read in the menu item (you may limit the length to a certain amount - such as 50 characters) Use the 3 argument version of cin.get for the menu item and cin.ignore after each and every input operation Echo what was read in. Then, expand this. Write a function to strip all punctuation from the array. You are encouraged to use the cctype library when figuring out if an element is punctuation! The next word is 1 or 2 characters long and proceed past those words. Again, this would be a great function to write! If the resulting menu item is 30 characters or less, you are done and it can be displayed. If not, then it is time to start working with the last character and begin removing every other vowel. Think how a for loop along with a function can help with that!! Stop when we have remove enough to be within the limit of 30 Task 7. After performing these tasks ask the user if they would like to do this again! Continue until the user wants to quit. To create the resulting menu item that will be sized appropriately to fit on their board, start small with only the first step of checking to see if what was entered was 30 characters or less. If it is, it can be displayed as is. If it isn't, look for words within the array that are "the" or "and", independent of capitalization. This should be done in a function! Think about how the same function can be used to work with "the" and "and" based on the argument supplied! This can be done by creating a new array with all of the data excluding these words or modifying the original array.