Question: Create a JAVA program (name your Java file as JavaVowels) with the following method: public static String replaceVowelInString(String inputString) The method returns a new String

Create a JAVA program (name your Java file as JavaVowels) with the following method: public static String replaceVowelInString(String inputString) The method returns a new String replacing each vowel in the given String with the opposite letter. Here is how Opposite Letter works: English alphabets have 26 letters (A to Z). A is the 1st and its opposite will be 26th (i.e., Z is the first from the end). You will replace A with Z. Similarly, E is the 5th letter from the start, and it will be replaced with the fifth letter from the end (i.e., V) and so on. You must not hardcode the replacement characters. Vowels may appear more than once in the same String. You should be using built-in methods of String class to find vowels and then replace them instead of using a loop. Hint: Get the appropriate index (or position) for a given vowel, then get the opposite letter using ASCII values, and then replace the vowel. Example: AAeEIooUu will return ZZvVRllFf

CANNOT USE LOOPING MUST USE STRING BUILT-IN METHODS

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!