Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Harness The Power Of Big Data The IBM Big Data Platform

Authors: Paul Zikopoulos, David Corrigan James Giles Thomas Deutsch Krishnan Parasuraman Dirk DeRoos Paul Zikopoulos

1st Edition

0071808183, 9780071808187

More Books

Students also viewed these Databases questions