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
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