10/27/22, 4:30 PM Assignment 5: Stackshttps://webcourses.ucf.edu/courses/1413634/assignments/ XXXXXXXXXX/2Assignment 5: StacksDue Friday by 11:59pm Points 100 Submitting a file upload File...

please follow all the steps


10/27/22, 4:30 PM Assignment 5: Stacks https://webcourses.ucf.edu/courses/1413634/assignments/7720885 1/2 Assignment 5: Stacks Due Friday by 11:59pm Points 100 Submitting a file upload File Types java Available until Nov 11 at 11:59pm Start Assignment One of the things my wife likes to do is speak pig latin. I can never understand it and it never works for me. I just end up adding ay to the end of each word. I think you have to move letters to the end, but really unsure about it. In that spirit I am going to ask you to using Java's Stack class to take a message and encode it. Let me explain how this will work. 1. Messages will be between 5 and 1,000,000 units long. 2. Messages will have groups to show which parts need to be encoded first. 3. The character '1' will show a start of a group, and the character '2' will the end 4. Each grouping will 3 characters. Take the middle value will always be a vowel and the two end values will be consonants. 5. Instead of consonants, another grouping can replace one or both of them. A grouping cannot replace a vowel. 6. You must evaluate the nested/replaced groupings. Since 1 and 2 give you the end you can read it left to right. 7. The output should only have the letters inside. Examples: Input Output 1cat2 cta 11top2e1cat22 tpoctae 111tom2op2it2 tmopoti 11top2i1tom22 tpotmoi Limitations Class Name: WordScramble Public Static Methods: String encode(String) Must use the Stack Class Strings will be no less than 5 10/27/22, 4:30 PM Assignment 5: Stacks https://webcourses.ucf.edu/courses/1413634/assignments/7720885 2/2 Strings will have the same amount of 1s and 2s. A 1 must come before a matching 2. Main Method To help you run the sample cases, I attached my main method from when I wrote the solution. Please include this in your program. The graders will add to this. public static void main(String[] args) { System.out.println(encode("1top2")); System.out.println(encode("11top2e1cat22")); System.out.println(encode("111tom2op2it2")); System.out.println(encode("11top2i1tom22")); }
Oct 27, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here