Question
Pig Latin Phrases String Manipulations Specification: Write a program that can convert English phrase into Pig Latin phrase. We are using a simplified Pig Latin
Pig Latin Phrases String Manipulations Specification: Write a program that can convert English phrase into Pig Latin phrase. We are using a simplified Pig Latin rule. The rule is to place the first character as the last character in the word and add ay at the end of the word. For instance, hello is converted to ellohay; Monday is converted to ondayMay; Are you a Java programmer? is converted to reAay ouyay aay avaJay rogrammerpay?. The last character in the phrase is a punctuation (. ? !, etc.) which stays at the same place. If the punctuation occurred inside of the phrase, but not at last position of the phrase, the punctuation will be converted with the word. Design a class that has the capability to do the conversion. This class does not have instance field or methods, nor constructors. It contains only two static methods. You will test PigLatinPhrase class in your main class. Class Design: You may add any additional variables and methods to implement the logic of your solution. Class Name: PigLatinPhrase Private data fields (properties): none Constructors: none Public static methods: Method name Return type Parameter list and purpose toPigLatinWord String (String word)->parameter list takes a String argument, converts the word into PigLatin form following the rule, return PigLatin word toPigLatinPhrase String (String phrase)->parameter list takes a String argument, parses the phrase into array of String, so that each array element contains a word, converts each word into PigLatin word and returns the PigLatin phrase Assignment Instructions: 1. Create a NetBeans project and named it FirstName_LastName_A4 2. Create a separate java class file named it PigLatinPhrase.java. This file contains the public class PigLatinPhrase 3. In your main class, prompt the users to enter a phrase, then display the PigLatin phrase. 4. Name your variables clearly 5. Add comments to document your project and code 6. Add space/indentation to make your code easier to read 7. Zip your assignment and submit it in Canvas for grading P
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started